export type ErrorKind = 'validation' | 'budget' | 'upstream' | 'timeout' | 'cancelled' | 'internal' | 'busy'; export interface ErrorMeta { retryable?: boolean; kind?: ErrorKind; } interface ToolError { code: string; message: string; retryable?: boolean; kind?: ErrorKind; } interface ToolTextContent { type: 'text'; text: string; } interface ToolEmbeddedResource { type: 'resource'; resource: { uri: string; mimeType: string; text: string; }; } export type ToolContentBlock = ToolTextContent | ToolEmbeddedResource; interface ToolStructuredContent { [key: string]: unknown; ok: boolean; result?: unknown; error?: ToolError; } interface ToolResponse { [key: string]: unknown; content: ToolContentBlock[]; structuredContent: TStructuredContent; } interface ErrorToolResponse { [key: string]: unknown; content: ToolContentBlock[]; isError: true; } export declare function createToolResponse(structured: TStructuredContent, textContent?: string): ToolResponse; /** * Build an error tool response with `isError: true`. * * Intentionally omits `structuredContent`. The MCP SDK skips `outputSchema` * validation when `isError` is true, so including it is unnecessary and could * create schema mismatches if the error shape diverges from the success shape. * Error details are available in `content[0].text` as JSON. */ export declare function createErrorToolResponse(code: string, message: string, result?: unknown, meta?: ErrorMeta): ErrorToolResponse; /** Shared meta for non-retryable validation errors across tools. */ export declare const VALIDATION_ERROR_META: ErrorMeta; export {};