interface RenderedError { content: Array<{ type: 'text'; text: string; }>; isError: true; } /** * Render an SDK error as an MCP tool execution result. * * An error result carries NO `structuredContent`. The official client * (@modelcontextprotocol/sdk 1.32) validates `structuredContent` against the * tool's outputSchema even when `isError` is true, so an error object there * reached the agent as "-32602 Structured content does not match the tool's * output schema" and the readable text was lost (2026-10-18 end-to-end run). * Instead the first text line is JSON with the machine fields (`code`, * `retryable`, and per error `retryAfterSeconds`, `actionUrl`, ...), and the * sentence for the agent follows on the next line. * * Local-file errors follow the same shape (`code`, `retryable: false`, and * `path` / `sizeBytes` / `detail`); a plain Error stays `Error: `. */ /** The plain sentence about the sandbox limits, also in the server instructions. */ export declare const SANDBOX_RATE_LIMIT_SENTENCE = "The sandbox key allows 2 requests a minute and 10 a day per IP; sign up for an account key at https://phototology.com/signup to lift this."; /** The SANDBOX_KEY explanation, also in the server instructions. */ export declare const SANDBOX_KEY_SENTENCE = "Sandbox keys cannot read the registry or a balance, or write metadata into a photo; analyze_photo and analyze_batch return fixture data; get an account key for lookups and balances"; export declare function renderToolError(err: unknown): RenderedError; /** RATE_LIMITED waits longer than this are not retryable within an agent session. */ export declare const MAX_RETRYABLE_WAIT_SECONDS = 600; /** * SANDBOX_KEY without a network call, for the routes an anonymous sandbox key * can never use (lookup, balance, enrich, the photo record). Answers only once * the start-up probe confirmed the key has no account: an account-linked * `pt_test_` key (phototology-web issues them) keeps working. Calling the API * anyway would spend the anonymous quota and, inside a closed window, show * RATE_LIMITED instead of the real reason. */ export declare function sandboxRefusal(): Promise; /** The SANDBOX_KEY sentence: tool errors and the photo resource say the same. */ export declare function sandboxKeyText(): string; export {}; //# sourceMappingURL=errors.d.ts.map