/** * Terminal-vs-transient classification for Senpi MCP tool failures. * * Terminal ("deterministic") failures fail identically on every retry with the * same arguments — bad input, auth, unknown resource, or a strategy that is * paused/closed. Retrying them burns credits and floods the MCP (see the * 2026-07 retry storms). Transient failures (network, 5xx, rate limits) stay * retryable. * * Classification order: * 1. The server's explicit `error.retryable` flag (senpi-hyperliquid-mcp * ships one on every error envelope) — always trusted when present. * 2. Known terminal error codes. * 3. Message patterns, covering older servers that miscode business * rejections (e.g. the PAUSED-strategy rejection surfaced as INTERNAL). */ export interface ToolErrorClassification { /** True when retrying the identical call cannot succeed. */ terminal: boolean; /** Best-known error code when terminal (null otherwise). */ code: string | null; } /** * Classify a tool failure. Accepts a parsed MCP response envelope * (`{success:false, error:{...}}`), a thrown Error, or a message string. */ export declare function classifyToolError(input: unknown): ToolErrorClassification; /** True when the failure is deterministic and must not be retried. */ export declare function isTerminalToolError(input: unknown): boolean; //# sourceMappingURL=tool-errors.d.ts.map