/** * Tool-result shaping for the MCP server. * * Every MCP tool returns a `CallToolResult` — `{ content: [...], * isError? }`. This module gives the tools one consistent way to * turn a `TracePassApiResponse` into that shape, and — critically — * to translate the v1 API's *meaningful* non-2xx responses into * results an AI agent can read and act on, rather than opaque * errors. * * The three responses an agent MUST be able to act on: * - 402 overage_required — the write would exceed the plan's DPP * quota; the agent can retry with `confirmOverage: true`. * - 403 plan-gated (e.g. epcis_capture_not_available) — the * feature isn't on the tenant's plan; the agent should tell the * user, not retry. * - 429 rate-limited — the daily write/read budget is spent; retry * tomorrow. * Surfacing these as readable `isError: true` text (not a thrown * exception) lets the model explain the situation to the user. */ /** The MCP CallToolResult shape (text content only — sufficient for * every TracePass tool; no tool returns binary). */ export interface ToolResult { content: Array<{ type: "text"; text: string; }>; isError?: boolean; structuredContent?: Record; } /** A plain text result. */ export declare function textResult(text: string): ToolResult; /** A successful result carrying JSON data — pretty-printed so the * model reads it cleanly, plus structuredContent for clients that * consume it. */ export declare function jsonResult(data: unknown): ToolResult; /** An error result — `isError: true` so the client renders it as a * failed tool call, with a human-readable explanation. */ export declare function errorResult(message: string): ToolResult; /** * Turn a v1 API response into a ToolResult. 2xx → jsonResult. The * meaningful non-2xx cases get a specific, actionable explanation; * anything else gets a generic error carrying the status + body. */ export declare function apiResult(res: { status: number; ok: boolean; body: unknown; }): ToolResult; //# sourceMappingURL=result.d.ts.map