/** * Tool Validator - Pre-validate MCP tools before scheduling * Implements MCP-native validation protocol with fallback * * Protocol: Tries tools/validate first (deep validation), falls back to schema validation */ export interface ValidationResult { valid: boolean; errors: string[]; warnings: string[]; validationMethod?: 'mcp-native' | 'schema-only' | 'test-execution'; schema?: any; testExecutionResult?: { success: boolean; output?: any; error?: string; duration: number; }; } export declare class ToolValidator { private orchestrator?; constructor(orchestrator?: any | undefined); /** * Validate tool and parameters before scheduling * * Validation Strategy: * 1. Try MCP-native validation (tools/validate) - GOLD STANDARD * 2. Fall back to schema-only validation if not supported * 3. Optional: Test execution as final verification */ validateTool(tool: string, parameters: Record, options?: { testRun?: boolean; timeout?: number; }): Promise; /** * Create a temporary orchestrator (fallback when none provided) * WARNING: This is slow! Prefer dependency injection for production use. */ private createTemporaryOrchestrator; /** * Try MCP-native validation (tools/validate method) * * This is the GOLD STANDARD for validation - allows MCPs to do deep validation * like checking if paths exist, testing database connections, verifying permissions, etc. * * Implementation follows capability-based approach: * 1. Check if MCP announces experimental.toolValidation capability * 2. If yes, call the validate tool * 3. If no, return not supported (skip validation attempt) */ private tryMCPNativeValidation; /** * Find tool in orchestrator */ private findTool; /** * Validate parameters against JSON schema */ private validateAgainstSchema; /** * Validate parameter type */ private validateType; /** * Run test execution */ private runTestExecution; } //# sourceMappingURL=tool-validator.d.ts.map