Skip to main content

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.
Input Schema:
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 answers
  • detailed: ~2000 tokens, 5-10 seconds - comprehensive explanations
Follows Anthropic’s best practice: “Expose a response_format enum parameter for token efficiency”
Example Usage:
Response:

Conversation Search Tool

Search conversations using keywords and filters. Replaces the old list_conversations tool following Anthropic’s guidance: “Implement search-focused tools rather than list-all tools.”
string
default:"conversation_search"
Tool identifier (namespaced for clarity)
Breaking Change (v2.6.0): The list_conversations tool has been replaced with conversation_search to prevent context overflow. Backward-compatible routing still supports the old name.
Input Schema:
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
Benefits over list-all:
  • Up to 50x reduction in response tokens for users with many conversations
  • Helpful truncation messages when results exceed limit
  • Sorted by relevance to query
Example Usage:
Response:
Truncation Guidance: When results exceed the limit:

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.
Input Schema:
Example Usage:
Response:

Execute Code Tool

Execute code in a sandboxed environment (if enabled).
string
default:"execute_code"
Tool identifier
Input Schema:
Example Usage:
Response:

Database Query Tool

Query databases (if configured and authorized).
string
default:"query_database"
Tool identifier
Input Schema:
Example Usage:
Response:

Tool Discovery

Tool Registration & Discovery Flow

List all available tools:
Response Format:

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:
Handle errors:

Custom Tools

Extend the server with custom tools:

Define Custom Tool

Use Custom Tool

Tool Permissions

Tools respect authorization rules:
Grant permission:

Tool Composition

Chain multiple tools:

Tool Monitoring

Track tool usage:

Best Practices

Always validate tool inputs against the schema:
Set appropriate timeouts for tool execution:
Retry transient failures:
Log all tool executions for debugging and auditing:

Troubleshooting

Error: Method not found: tool 'xyz' does not existSolutions:
Error: User does not have permission to execute toolSolutions:
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!