import type { MCPTool, MCPPrompt, MCPResource, MCPResourceTemplate, MCPServerInfo, MCPServerCapabilities } from '../transport/types.js'; /** * Result of discovering an MCP server's capabilities. */ export interface DiscoveryResult { /** Server identification info */ serverInfo: MCPServerInfo; /** Protocol version negotiated */ protocolVersion: string; /** Server capabilities */ capabilities: MCPServerCapabilities; /** List of available tools */ tools: MCPTool[]; /** List of available prompts */ prompts: MCPPrompt[]; /** List of available resources */ resources: MCPResource[]; /** List of available resource templates */ resourceTemplates: MCPResourceTemplate[]; /** Server-provided instructions for the client */ instructions?: string; /** Timestamp of discovery */ timestamp: Date; /** Command used to start the server */ serverCommand: string; /** Arguments passed to the server */ serverArgs: string[]; /** Transport-level errors captured during discovery */ transportErrors?: TransportErrorRecord[]; /** Warnings about potential issues */ warnings?: DiscoveryWarning[]; } /** * Detailed tool information with parsed schema. */ export interface ToolDetail { name: string; description: string; inputSchema: ToolInputSchema | null; requiredParams: string[]; optionalParams: string[]; } /** * Parsed JSON Schema for tool inputs. */ export interface ToolInputSchema { type: string; properties?: Record; required?: string[]; additionalProperties?: boolean; } export interface PropertySchema { type: string; description?: string; enum?: string[]; default?: unknown; items?: PropertySchema; } /** * Classification of transport-level errors. * Used to differentiate between server bugs, protocol issues, and environment problems. */ export type TransportErrorCategory = 'invalid_json' | 'buffer_overflow' | 'connection_refused' | 'auth_failed' | 'connection_lost' | 'protocol_violation' | 'timeout' | 'shutdown_error' | 'unknown'; /** * Record of a transport-level error that occurred during MCP communication. */ export interface TransportErrorRecord { /** When the error occurred */ timestamp: Date; /** Classification of the error */ category: TransportErrorCategory; /** Human-readable error message */ message: string; /** Original error message (if available) */ rawError?: string; /** The operation being performed when error occurred */ operation?: string; /** Whether this error is likely a server bug vs environment/config issue */ likelyServerBug: boolean; } /** * Warning about potential issues discovered during server inspection. */ export interface DiscoveryWarning { /** Warning severity level */ level: 'info' | 'warning' | 'error'; /** Warning message */ message: string; /** Recommendation for addressing the warning */ recommendation?: string; } //# sourceMappingURL=types.d.ts.map