/** * MCP Tool Registry * * Central registry for discovering and managing MCP tools defined via decorators */ import "reflect-metadata"; import type { MCPToolResult } from "../types/mcp-types.js"; /** * JSON Schema type definitions */ interface JSONSchemaProperty { type: string; description?: string; enum?: unknown[]; items?: unknown; default?: unknown; properties?: Record; required?: string[]; } interface JSONSchema { type: string; properties: Record; required?: string[]; } /** * MCP Tool Definition (as returned by ListTools) */ export interface MCPToolDefinition { name: string; description: string; inputSchema: JSONSchema; } /** * MCP Tool Registry * * Discovers decorated methods in handler classes and auto-generates tool schemas */ export declare class MCPToolRegistry { private tools; /** * Register a handler instance * * Scans the handler for @MCPTool decorated methods and registers them */ registerHandler(handler: object): void; /** * Get all registered tool definitions (for ListTools handler) */ getToolDefinitions(): MCPToolDefinition[]; /** * Execute a tool by name (for CallTool handler) */ executeTool(name: string, args: any): Promise; /** * Check if a tool is registered */ hasTool(name: string): boolean; /** * Get count of registered tools */ getToolCount(): number; /** * Generate JSON Schema from method signature * * For now, this returns a basic object schema. The handler methods * use TypeScript types which provide compile-time safety. * Future enhancement: Use TypeScript compiler API to extract detailed schema */ private generateSchema; /** * Infer JSON Schema type from TypeScript type */ private inferType; } export {}; //# sourceMappingURL=tool-registry.d.ts.map