/** * A tool error that is reported back to the MCP client as a tool result with * `isError: true`. Always carries a machine-readable code and a repair hint so * that the model can correct its call. */ export declare class McpToolError extends Error { code: string; hint?: string | undefined; constructor(code: string, message: string, hint?: string | undefined); toJSON(): { error: { code: string; message: string; hint: string | undefined; }; }; } /** * Map an arbitrary error (e.g. a failed upstream fetch) to a tool error. */ export declare function toToolError(e: unknown): McpToolError;