European Parliament MCP Server API - v1.2.6
    Preparing search index...
    • Build an error response from an error value or message string. Never exposes raw stack traces to MCP clients.

      When no explicit classification is provided, the error is automatically classified via classifyError so all error responses — whether routed through handleToolError or built directly by tool handlers — include consistent errorCode, errorCategory, and retryable metadata.

      Parameters

      • error: unknown

        Error instance or message string

      • toolName: string

        Name of the tool that produced the error

      • Optionalclassification: ErrorClassification

        Optional pre-computed classification (auto-classified if omitted)

      Returns ToolResult

      MCP-compliant ToolResult with isError flag set