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.

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 detail.
source.pointerOptional JSON pointer to the invalid input location.
source.parameterOptional parameter reference.
metaOptional structured metadata, such as allowed values or received value.

MCP Tool Error Behavior

Tool-level errors are returned inside the MCP tool result.

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

Tool-level failures can be returned within a successful HTTP response. Clients should inspect the MCP tool result rather than relying solely on the HTTP status code.

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


Error Categories

The following error codes are currently implemented.

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 dataset string is not an implemented dataset.
DOWNSTREAM_REQUEST_FAILED502A downstream request returned a non-OK response.
DOWNSTREAM_BAD_RESPONSE502A downstream response did not match the expected shape.
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.
UNEXPECTED_INTERNAL_ERROR500An unknown runtime failure occurred.

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.

Common causes include:

CauseExample
Unsupported datasetdataset is not one of job_postings or profiles,
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.

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


Execution Errors

Execution errors occur after request validation succeeds. These failures are typically caused by downstream service responses, authentication issues, network failures, or dependency health problems.

Failure TypeClient Guidance
Downstream request failedReview the request and returned error details.
Downstream bad responseTreat as a service-side response-shape issue.
Downstream unavailableRetry may be appropriate, depending on the calling workflow.
Downstream auth failedTreat as a service configuration or credential issue.

Retry Behavior

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

AreaBehavior
OAuth tokensTokens 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 MCP-layer retry contract is currently documented.


Did this page help you?