/** * Custom error classes for MCP tool execution errors */ import { McpError } from "@modelcontextprotocol/sdk/types.js"; /** * Error thrown when an MCP protocol-level error occurs during tool execution * (e.g., connection failures, transport errors, server crashes) * * Extends McpError to preserve MCP error structure (code, message, data) * and adds stderr output from the MCP server process */ export declare class ToolCallMcpError extends McpError { /** * Array of stderr lines captured from the MCP server process * This is particularly useful for stdio-based MCP servers that write * detailed error information to stderr */ readonly stderr: string[]; constructor(mcpError: McpError, stderr: string[]); } /** * Error thrown when an MCP tool call completes successfully at the protocol level, * but the tool itself returns an error response (result.isError = true) * * This represents a logical failure in the tool execution, not a protocol failure. * The full result object is preserved for inspection. */ export declare class ToolCallError extends Error { /** * The complete result object from the MCP tool call * This includes the error response, content, and any other result properties */ readonly result: { isError?: boolean; content: unknown[]; error?: unknown; [key: string]: unknown; }; constructor(result: { isError?: boolean; content: unknown[]; error?: unknown; [key: string]: unknown; }); } //# sourceMappingURL=mcp-tool-error.d.ts.map