Skip to main content
Tools are the primary way your MCP server exposes functionality to AI agents. Each tool is a Python function that the LLM can call.

Defining Tools

Use the @app.tool() decorator:
The docstring becomes the tool’s description that the LLM sees. Write clear, action-oriented descriptions so the LLM knows when to use each tool.

Type Annotations

Concierge uses type annotations to generate the tool’s JSON schema. The LLM sees this schema and knows what arguments to provide:
This generates a schema with name and email as required, age and tags as optional with defaults.

Return Values

Tools should return JSON-serializable data (dicts, lists, strings, numbers):

Tools with State

Tools can read and write session state:

Assigning Tools to Stages

When using stages, map tool names to stages:
A tool not assigned to any stage is never visible to the agent (unless you have no stages defined, in which case all tools are visible).

Error Handling

Return errors as data:don’t raise exceptions:
The LLM can read the error and decide what to do next:retry, ask the user for clarification, or try a different approach.