Skip to main content
You expose a function as an MCP tool for AI agents to invoke. With .describe() you tell the agent what each parameter does. Pattern: clear name + description + .describe() on each field + MCP active (default).
index.ts

Local testing

Why it works this way

  • name and description are what the AI agent sees to decide when to use this tool.
  • .describe() on each field generates the parameter descriptions in the MCP schema.
  • The output schema documents what structure the function returns.
  • MCP is active by default (config.mcp: true), so the /mcp endpoint automatically exposes the tool.
  • An AI agent can call this function when a user asks “do you have laptops under $1500?”.