European Parliament MCP Server API - v1.2.6
    Preparing search index...
    • Classify an error into a structured error code, category, and retryability.

      Priority:

      1. If the error is a ToolError with explicit errorCode already set, use it. Retryability is derived from the error code's standard meaning (via retryableForCode) rather than ToolError.isRetryable, ensuring consistency even when callers set errorCode without a matching isRetryable. Note: ToolError.isRetryable is ignored when errorCode is present.
      2. Inspect the error and its cause chain for HTTP status codes (for example from APIError) and classify from the resolved status.
      3. If the error is a ToolError without an explicit errorCode, apply heuristic classification, including operation-based mappings (validateInputINVALID_PARAMS) and message-based timeout detection.
      4. If the error is a ZodError (validation failure), classify as INVALID_PARAMS / CLIENT_ERROR.
      5. If the error is a plain Error, apply message-based timeout detection (timed outUPSTREAM_TIMEOUT).
      6. Default to INTERNAL_ERROR.

      Parameters

      • error: unknown

        The caught error value

      Returns ErrorClassification

      Structured classification with code, category, httpStatus, and retryable flag