European Parliament MCP Server API - v1.0.1
    Preparing search index...
    • Handle a caught tool error, returning a safe MCP error response. Never exposes raw stack traces to MCP clients.

      If the error is a ToolError, its own toolName and isRetryable are used so the originating tool and retryability are correctly surfaced to callers even when the error crosses handler boundaries.

      Parameters

      • error: unknown

        Caught error value

      • toolName: string

        Fallback tool name when error carries no tool identity

      Returns ToolResult

      MCP-compliant ToolResult with isError flag set