Your First Generated Tool
MCP tool definitions are generated from the Semantic Manifest. Each manifest operation becomes a callable tool that agent runtimes can discover and invoke.
You don't write them. @web-axag/compiler emits them on every build, or run npx @web-axag/cli generate src --tools tools/tool-registry.json in CI.
From Manifest to Tool
Given the manifest entry from the previous step, the generated MCP tool definition is:
MCP tool — product_search
{
"name": "product_search",
"description": "Search the product catalog by text query with optional filters",
"input_schema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Free-text search query for product name, description, or SKU"
},
"category": { "type": "string", "description": "Filter by product category" },
"price_min": { "type": "number", "description": "Minimum price filter" },
"price_max": { "type": "number", "description": "Maximum price filter" }
},
"required": ["query"]
},
"metadata": {
"action_type": "read",
"risk_level": "none",
"idempotent": true,
"confirmation_required": false,
"approval_required": false,
"source_intent": "product.search",
"source_entity": "product"
}
}
Tool Structure
MCP tool definitions contain:
| Field | Purpose |
|---|---|
name | Unique identifier derived from the intent (product.search → product_search) |
description | Human-readable description for agent planning |
input_schema | JSON Schema for tool parameters |
metadata | Action type, risk, idempotency, confirmation, and the source intent |
How Agents Use This Tool
An agent runtime:
- Discovers
product_searchin the tool registry - Plans to use it based on user request (e.g., "Find red running shoes under $100")
- Constructs parameters:
{ "query": "red running shoes", "price_max": 100 } - Validates that required parameters are present
- Checks safety — read operation, no risk, no confirmation needed
- Executes the tool
- Returns results to the user