Overview
MCP tools are executable functions that the server exposes to clients. Each tool has a defined schema, inputs, and outputs, enabling AI agents to perform specific actions.Tools enable AI agents to interact with external systems, execute code, search data, and perform complex operations beyond text generation.
Available Tools
Agent Chat Tool
Send a message to the AI agent and receive an intelligent response optimized for agent consumption.string
default:"agent_chat"
Tool identifier (namespaced for clarity)
Backward Compatibility: The old tool name
chat is still supported for backward compatibility.Response Format Control: New in v2.6.0. Agents can optimize for speed vs comprehensiveness:
concise(default): ~500 tokens, 2-5 seconds - ideal for quick answersdetailed: ~2000 tokens, 5-10 seconds - comprehensive explanations
Conversation Search Tool
Search conversations using keywords and filters. Replaces the oldlist_conversations tool following Anthropic’s guidance: “Implement search-focused tools rather than list-all tools.”
string
default:"conversation_search"
Tool identifier (namespaced for clarity)
Why Search-Focused? Following Anthropic’s best practices:
- Prevents context overflow: Listing all conversations can consume thousands of tokens
- Forces specificity: Agents must be explicit about what they’re looking for
- More efficient: Returns only relevant results, not everything
- Scalable: Works with users who have hundreds of conversations
- Up to 50x reduction in response tokens for users with many conversations
- Helpful truncation messages when results exceed limit
- Sorted by relevance to query
Conversation Get Tool
Retrieve a specific conversation thread by ID.string
default:"conversation_get"
Tool identifier (namespaced for clarity)
Best Practice: Use
conversation_search first to find conversation IDs, then use conversation_get to retrieve specific conversations.Execute Code Tool
Execute code in a sandboxed environment (if enabled).string
default:"execute_code"
Tool identifier
Database Query Tool
Query databases (if configured and authorized).string
default:"query_database"
Tool identifier
Tool Discovery
Tool Registration & Discovery Flow
List all available tools:Tool Execution
Synchronous Execution
Standard request-response pattern:Asynchronous Execution
For long-running tools:Streaming Execution
For tools that support streaming:Error Handling
Tools may return errors in the response:Custom Tools
Extend the server with custom tools:Define Custom Tool
Use Custom Tool
Tool Permissions
Tools respect authorization rules:Tool Composition
Chain multiple tools:Tool Monitoring
Track tool usage:Best Practices
Validate Inputs
Validate Inputs
Always validate tool inputs against the schema:
Handle Timeouts
Handle Timeouts
Set appropriate timeouts for tool execution:
Implement Retry Logic
Implement Retry Logic
Retry transient failures:
Log Tool Usage
Log Tool Usage
Log all tool executions for debugging and auditing:
Troubleshooting
Tool not found
Tool not found
Error:
Method not found: tool 'xyz' does not existSolutions:Permission denied
Permission denied
Error:
User does not have permission to execute toolSolutions:Invalid arguments
Invalid arguments
Error:
Invalid params: required field 'query' missingSolutions:Next Steps
MCP Messages
Message protocol reference
MCP Resources
Resource types and access
MCP Endpoints
Available endpoints
Authorization
Tool permissions
MCP Tools Ready: Powerful, composable tools for AI agent capabilities!