import type { McpToolResult } from "../interfaces/mcp.tool.interface"; /** * MCP tool error codes (C10). Every executor failure is returned to the MCP * client as a FLAT JSON payload `{ code, message, ...meta }` — mirroring the * flat-error convention used by the HTTP layer's HttpExceptionFilter. */ export type McpErrorCode = "unknown_type" | "forbidden" | "validation_failed" | "not_found" | "internal"; /** * Maps an unknown thrown value to a flat MCP error result. * * - `HttpException` → status-derived code (404 → not_found, 403 → forbidden, * 400/422 → validation_failed, anything else → internal) * - `ZodError` → validation_failed with per-issue `issues` meta * - other `Error` → internal with the error message * * Never includes stack traces. */ export declare function mcpError(e: unknown): McpToolResult; /** * Builds a flat MCP error result directly from a code + message (+ optional meta). * The payload shape is intentionally flat: `{ code, message, ...meta }`. */ export declare function mcpFlatError(code: string, message: string, meta?: Record): McpToolResult; //# sourceMappingURL=mcp.errors.d.ts.map