Errors

Overview

Lightcast MCP returns structured errors when a request cannot be processed successfully.

Errors can occur during request validation, tool execution, downstream service communication, or dependency health checks. Error responses are designed to help clients identify the cause of a failure and determine whether a request should be corrected, retried, or escalated.

Lightcast MCP uses a JSON error structure with stable application error codes for tool-level failures.

Error Structure

An error object contains information about what failed and, when applicable, where the failure occurred.

FieldDescription
statusHTTP-style status code as a string.
codeStable Lightcast MCP error code.
titleShort error title.
detailHuman-readable description of the error.
source.pointerOptional JSON pointer to the invalid input location.
source.parameterOptional parameter reference.
metaOptional structured metadata, such as allowed values or received value.

Each request has a request ID for log correlation. Lightcast MCP returns this identifier in the x-trace-id response header, not in the error body.

Error responses do not include internal stack traces. When contacting support, provide the request ID to help troubleshoot the failure.

MCP Tool Error Behavior

Tool-level errors are returned as MCP tool results over HTTP 200.

When a tool call fails:

  • isError is set to true
  • Error details are returned as MCP text content items
  • One or more JSON error objects describe the failure

Clients should inspect the MCP tool result rather than relying solely on the HTTP status code. Missing, invalid, or expired credentials and ingress rate limit violations are returned as HTTP 401 and HTTP 429 responses, respectively.

Non-MCP endpoints, such as dependency health checks, may return traditional HTTP error responses with an { "errors": [...] } response body.

Authentication and Rate Limit Errors

The following table describes authentication failures and rate limit violations.

SituationCode and StatusClient Guidance
Missing credential or invalid or expired tokenHTTP 401 with a WWW-Authenticate header. OAuth returns invalid_token for an invalid or expired token, or invalid_request when no credential is provided. This is not a JSON error code.Sign in again or request a new token. Most AI assistants automatically prompt you to sign in when they receive this response.
Account not assigned to an organizationSign-in is refused with organization_membership_required. No token is issued.Contact your Lightcast representative to be added to your organization.
Rate limit reachedHTTP 429 with INGRESS_RATE_LIMIT_EXCEEDED. The response includes the Retry-After, X-RateLimit-Limit, and X-RateLimit-Remaining headers.Wait for the duration specified in the Retry-After header, then retry.

Access and Quota Errors

Access and quota errors occur when a requested dataset or tool is not included in your organization's plan, or when your organization's quota is exhausted or unavailable.

The status values in this table represent the status field in the JSON error object, not the HTTP response status.

CodeStatusMeaningClient Guidance
FORBIDDEN403The requested dataset or tool is not included in your access.Contact your Lightcast representative. Do not retry.
ORGANIZATION_QUOTA_EXCEEDED429Your organization's quota for the current period is exhausted. The error detail identifies the exhausted quota period and when it resets.Wait until the quota resets or contact your Lightcast representative. Do not retry before the reset.
QUOTA_SERIES_NOT_FOUND404Your organization has no active quota, or no quota period covers the current date. The error detail indicates that no current quota period is configured.Contact your Lightcast representative.

When an organization's quota is exhausted, the response includes the following headers:

  • RateLimit-Limit
  • RateLimit-Remaining
  • RateLimit-Reset

Validation Errors

Validation errors occur before a request reaches a downstream service. These errors indicate that the request does not satisfy the selected dataset, tool contract, or schema requirements.

The status values in this table represent the status field in the JSON error object.

CodeStatusMeaning
VALIDATION_FAILED400Tool input failed schema or adapter validation.
INVALID_ARGUMENT400A required high-level argument, such as dataset, is missing or malformed.
TOOL_INVALID_COMBINATION400The requested dataset/tool pair is not supported.
TOOL_UNSUPPORTED_DATASET400The specified dataset is not an implemented dataset.

Common Validation Errors

CauseExample
Unsupported datasetSpecifying an unsupported dataset identifier.
Unsupported tool combinationCalling timeseries with profiles.
Unsupported metricRequesting a profiles metric from job_postings.
Invalid operatorUsing and on a dimension that only supports or.
Missing required filterOmitting time for a job_postings analysis request.
Invalid rangeSupplying an upper bound lower than a lower bound, or specifying a top limit outside the supported range of 1 to 100.
Mixed regional dimensionsCombining US-only and Global-only dimensions in a single request.

Validation errors may include JSON pointers such as /filter/time or /metrics/0, along with metadata describing the expected values or structure.

Range validation errors include the accepted range.

Requests that combine US-only and Global-only dimensions return a VALIDATION_FAILED error 400. The error detail indicates that a single request cannot combine dimensions from different regions. Use dimensions from a single region in each request.

Execution Errors

Execution errors occur after request validation succeeds. These failures may be caused by downstream service responses, authentication issues, network failures, dependency health problems, service capacity, or quota usage recording failures.

The status values in this table represent the status field in the JSON error object.

CodeStatusMeaning
DOWNSTREAM_REQUEST_FAILED502A downstream request returned a non-OK response.
DOWNSTREAM_BAD_RESPONSE502A downstream response did not match the expected shape.
DOWNSTREAM_BAD_REQUEST502A downstream data service rejected the request.
DOWNSTREAM_UNAVAILABLE503A downstream service was unavailable, returned a 5xx response, or had a network failure.
DOWNSTREAM_AUTH_FAILED500Downstream authentication failed after implemented retry behavior.
DEPENDENCY_UNHEALTHY503A dependency status check reported unhealthy.
DEPENDENCY_CHECK_FAILED503A dependency status check failed or rejected.
EGRESS_QUEUE_SATURATED503The service is busy.
QUOTA_USAGE_RECORDING_UNAVAILABLE503The service could not record usage for the request.
UNEXPECTED_INTERNAL_ERROR500An unknown runtime failure occurred.

Client Guidance

Failure TypeClient Guidance
Downstream request failedReview the request and returned error details.
Downstream bad responseTreat as a service-side response-shape issue.
Downstream bad requestCheck the inputs against Tool Info and retry. If the error persists, contact support with the request ID.
Downstream unavailableRetry may be appropriate, depending on the calling workflow.
Downstream authentication failedTreat as a service configuration or credential issue.
Service busyWait, then retry.
Quota usage recording unavailableWait, then retry.

Retry Behavior

Some execution errors may be retried automatically depending on the downstream service and failure type.

AreaBehavior
OAuth tokensDownstream access tokens are cached by scope and refreshed before expiry.
Downstream 401 responsesThe server can invalidate the token and retry once.
Profiles 429 or 5xx responsesProfiles requests retry once, using Retry-After when available or a short exponential delay.
Job postings 429 or 5xx responsesNo documented retry beyond returning downstream errors.
Government occupations 429 or 5xx responsesNo documented retry beyond returning downstream errors.
MCP layerNo standardized automatic retry contract is currently documented.

Planned Enhancements

Server version reporting in error responses is planned. When this capability becomes available, agents should retrieve the tool schema again using Tool Info whenever they detect a new server version.


Did this page help you?