mcp/tools/base_tool library

Base class for MCP tools with dependency injection.

Each tool implementation should extend this class and provide:

  • name: Unique tool identifier
  • description: Human-readable description of what the tool does
  • inputSchema: JSON schema for tool arguments
  • outputSchema: Optional JSON schema for tool output
  • annotations: Optional tool behavior hints (readOnly, destructive, etc.)
  • meta: Optional metadata for the tool
  • execute: Implementation of the tool logic

Classes

BaseTool
Base class for all MCP tools.

Extensions

ToolRegistration on McpServer
Extension to register tools with an MCP server.