Skip to main content

MCP Tools

Tools are the most powerful MCP primitive. They let AI assistants execute code on your server — querying databases, calling APIs, processing files, and performing any action your application supports.

Registering Tools

Basic Tool
Write clear, specific tool descriptions. The AI uses these to decide when and how to call your tools. A good description is the difference between a tool that gets used correctly and one that gets ignored.

Tool Input Schema

The inputSchema tells the AI what parameters your tool accepts:
Rich Input Schema

Error Handling

When a tool encounters an error, return isError: true:
Error Result

Practical Examples

Content Types

Tool results can include different content types:
Multiple Content Types

What’s Next

Resources

Expose data as readable resources

Transports

Deploy your MCP server over stdio or HTTP