/** * MCPToolAdapter - Model Context Protocol style tool adapter * Allows external tools to be registered and executed through a standard protocol */ import { ActionResult, ScreenState } from '../types'; import { ToolSpec } from './ToolRegistry'; /** * MCP Tool definition (external tool that can be called) */ export interface MCPTool { name: string; description: string; inputSchema: { type: 'object'; properties: Record; required?: string[]; }; handler: (params: Record, context: MCPToolContext) => Promise; } export interface MCPToolProperty { type: 'string' | 'number' | 'boolean' | 'array' | 'object'; description: string; enum?: string[]; items?: MCPToolProperty; properties?: Record; } export interface MCPToolContext { screenState: ScreenState; workspaceDir: string; metadata?: Record; } export interface MCPToolResult { content: Array<{ type: 'text' | 'image' | 'resource'; text?: string; data?: string; mimeType?: string; }>; isError?: boolean; } /** * MCPToolAdapter - Manages external MCP-style tools */ export declare class MCPToolAdapter { private tools; private toolCallHistory; /** * Register an MCP tool */ registerTool(tool: MCPTool): void; /** * Unregister an MCP tool */ unregisterTool(name: string): boolean; /** * Execute an MCP tool */ executeTool(toolName: string, params: Record, context: MCPToolContext): Promise; /** * Get all registered MCP tools */ getTools(): MCPTool[]; /** * Get tool by name */ getTool(name: string): MCPTool | undefined; /** * Convert MCP tools to ToolSpec format */ toToolSpecs(): ToolSpec[]; /** * Get tool call history */ getHistory(limit?: number): typeof this.toolCallHistory; /** * Clear tool call history */ clearHistory(): void; private validateParams; private convertMCPResult; private mcpToToolSpec; } /** * Built-in MCP tools */ export declare class BuiltInMCPTools { /** * Create a web search tool */ static createWebSearchTool(): MCPTool; /** * Create a calculator tool */ static createCalculatorTool(): MCPTool; /** * Create a date/time tool */ static createDateTimeTool(): MCPTool; /** * Get all built-in MCP tools */ static getAllTools(): MCPTool[]; } //# sourceMappingURL=MCPToolAdapter.d.ts.map