Auto-generation of MCP tools
When you create a function withdefine(), it is automatically exposed as an MCP (Model Context Protocol) tool. Your AI agents can discover and invoke your function as a tool without additional configuration.
Example
For this function:index.ts
/mcp endpoint exposes this schema:
The description field: the most important thing for MCP
.describe() annotations on fields
Zod .describe() annotations become parameter descriptions in the MCP tool. This is what AI agents see when they discover your function:
Testing the MCP endpoint
Start the local server withjelou functions dev and query the MCP schema:
Disabling MCP
If your function should not be discoverable as a tool (for example, a webhook that only receives callbacks), disable MCP:/mcp endpoint returns 404.
How agents use it
When you configure an AI agent in Jelou Brain Studio and assign functions as tools, the agent:- Discovers available tools via the
/mcpendpoint - Reads the name, description, and input schema
- Decides when to invoke the tool based on the user’s conversation
- Sends validated parameters to your function
- Receives the response and incorporates it into the conversation
define() and assign it to the agent.
Multi-tool MCP
When you useapp(), a single MCP server at /mcp automatically registers all tools. Each tool appears as an independent tool with its name, description, and schema.
To exclude a specific tool from the MCP registry, use mcp: false in its config:
queryBalance via MCP but paymentWebhook is only accessible via direct HTTP at /payment-webhook.