/** * Standard error result shape returned from tool handlers when a call fails. * Mirrors the MCP `tools/call` error convention: `isError: true` plus a single * text content block containing a JSON-encoded payload the calling agent can * parse for structured handling. */ export interface ToolErrorResult { isError: true; content: Array<{ type: 'text'; text: string; }>; } export interface ToolErrorPayload { code: string; message: string; [key: string]: unknown; } /** * Map an unknown error (most often a `UserFacingError` from core) onto the * standard tool error result. Unknown error types are reported under the * `internal` code with their `.message` (no stack — agents don't need it). */ export declare const toMcpError: (err: unknown) => ToolErrorResult; /** * Convenience constructor for the well-known `key_missing` error returned by * empirical and latency tools when the required provider env var is unset. */ export declare const keyMissingError: (required: string, docs?: string) => ToolErrorResult; export declare const errorResult: (payload: ToolErrorPayload) => ToolErrorResult; //# sourceMappingURL=errors.d.ts.map