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.
| Field | Description |
|---|---|
status | HTTP-style status code as a string. |
code | Stable Lightcast MCP error code. |
title | Short error title. |
detail | Human-readable description of the error. |
source.pointer | Optional JSON pointer to the invalid input location. |
source.parameter | Optional parameter reference. |
meta | Optional 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:
isErroris set totrue- 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.
| Situation | Code and Status | Client Guidance |
|---|---|---|
| Missing credential or invalid or expired token | HTTP 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 organization | Sign-in is refused with organization_membership_required. No token is issued. | Contact your Lightcast representative to be added to your organization. |
| Rate limit reached | HTTP 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.
| Code | Status | Meaning | Client Guidance |
|---|---|---|---|
FORBIDDEN | 403 | The requested dataset or tool is not included in your access. | Contact your Lightcast representative. Do not retry. |
ORGANIZATION_QUOTA_EXCEEDED | 429 | Your 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_FOUND | 404 | Your 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-LimitRateLimit-RemainingRateLimit-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.
| Code | Status | Meaning |
|---|---|---|
VALIDATION_FAILED | 400 | Tool input failed schema or adapter validation. |
INVALID_ARGUMENT | 400 | A required high-level argument, such as dataset, is missing or malformed. |
TOOL_INVALID_COMBINATION | 400 | The requested dataset/tool pair is not supported. |
TOOL_UNSUPPORTED_DATASET | 400 | The specified dataset is not an implemented dataset. |
Common Validation Errors
| Cause | Example |
|---|---|
| Unsupported dataset | Specifying an unsupported dataset identifier. |
| Unsupported tool combination | Calling timeseries with profiles. |
| Unsupported metric | Requesting a profiles metric from job_postings. |
| Invalid operator | Using and on a dimension that only supports or. |
| Missing required filter | Omitting time for a job_postings analysis request. |
| Invalid range | Supplying an upper bound lower than a lower bound, or specifying a top limit outside the supported range of 1 to 100. |
| Mixed regional dimensions | Combining 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.
| Code | Status | Meaning |
|---|---|---|
DOWNSTREAM_REQUEST_FAILED | 502 | A downstream request returned a non-OK response. |
DOWNSTREAM_BAD_RESPONSE | 502 | A downstream response did not match the expected shape. |
DOWNSTREAM_BAD_REQUEST | 502 | A downstream data service rejected the request. |
DOWNSTREAM_UNAVAILABLE | 503 | A downstream service was unavailable, returned a 5xx response, or had a network failure. |
DOWNSTREAM_AUTH_FAILED | 500 | Downstream authentication failed after implemented retry behavior. |
DEPENDENCY_UNHEALTHY | 503 | A dependency status check reported unhealthy. |
DEPENDENCY_CHECK_FAILED | 503 | A dependency status check failed or rejected. |
EGRESS_QUEUE_SATURATED | 503 | The service is busy. |
QUOTA_USAGE_RECORDING_UNAVAILABLE | 503 | The service could not record usage for the request. |
UNEXPECTED_INTERNAL_ERROR | 500 | An unknown runtime failure occurred. |
Client Guidance
| Failure Type | Client Guidance |
|---|---|
| Downstream request failed | Review the request and returned error details. |
| Downstream bad response | Treat as a service-side response-shape issue. |
| Downstream bad request | Check the inputs against Tool Info and retry. If the error persists, contact support with the request ID. |
| Downstream unavailable | Retry may be appropriate, depending on the calling workflow. |
| Downstream authentication failed | Treat as a service configuration or credential issue. |
| Service busy | Wait, then retry. |
| Quota usage recording unavailable | Wait, then retry. |
Retry Behavior
Some execution errors may be retried automatically depending on the downstream service and failure type.
| Area | Behavior |
|---|---|
| OAuth tokens | Downstream access tokens are cached by scope and refreshed before expiry. |
| Downstream 401 responses | The server can invalidate the token and retry once. |
| Profiles 429 or 5xx responses | Profiles requests retry once, using Retry-After when available or a short exponential delay. |
| Job postings 429 or 5xx responses | No documented retry beyond returning downstream errors. |
| Government occupations 429 or 5xx responses | No documented retry beyond returning downstream errors. |
| MCP layer | No 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.
Updated 11 days ago

