Skip to main content
Both developer surfaces return a stable, machine-readable error_code so an agent can branch on the failure instead of parsing prose. The CLI puts it in the --json error envelope; the MCP prefixes the tool-failure message with [error_code]. The same vocabulary backs both, mapped from the backend’s HTTP status (or from a structured body the backend sends). This page is the index of those codes. For how the CLI emits the envelope and exit codes, see global flags. For how the MCP renders failures, see tool conventions.

CLI error envelope

In --json mode every failure prints a JSON object to stderr and the process exits non-zero.
string
The human-readable message. Server-side entity names are remapped to CLI vocabulary (Product becomes Workspace, Profile becomes Person).
string
The stable code from the table below. Branch on this, not on the message text.
boolean
true only for transient failures (timeout, rate limit, 5xx, network). A retryable code is safe to retry after a short wait; a non-retryable one needs a fix first.
string[]
Zero or more actionable next steps. Present on most codes.
string
Optional. A finer sub-type on some client-thrown failures (see error_kind).
string
Optional. A copy-pasteable invocation that fixes the call (for example, the same command with --yes).
The exit code is derived from the same failure. See the exit-code table: 0 success, 1 general (including billing walls), 2 usage or validation, 3 auth, 4 not found, 5 transient.

MCP error format

A failing MCP tool raises a tool error whose message is prefixed with the bracketed code, so the calling model can read both at once:
When the backend sends a structured envelope (media pre-flight, rehost), the message also carries a Suggestions: ... line and an [envelope] {json} suffix the agent can parse for the modality-specific error_kind, suggestions, and any extra fields. See tool conventions for the shared id and validation rules that raise [validation_error] before any backend call.

Error codes

The core vocabulary, mapped from the backend HTTP status. The CLI and MCP map identically except for HTTP 403, noted below.
The CLI and MCP map HTTP 403 differently. The CLI distinguishes a true permission failure (forbidden) from a token problem (auth_failed is 401 only); the MCP folds both into auth_failed. Branch on the code your surface returns, not on the status.

Body-supplied codes

These codes are not in the status map. The backend sends them in the response body and both surfaces prefer them over the status-derived code. usage_limit_reached and insufficient_credits are distinct: the first means too many stored studies, people, or workspaces; the second means the per-run credit pool ran out.
Do not treat a billing wall as an auth failure. usage_limit_reached and insufficient_credits both arrive on a 403 or 402 but exit 1 on the CLI. Re-authenticating loops forever. Free a slot, buy credits, or upgrade instead.

Structured (modality) error kinds

Media pre-flight and rehost failures replace the generic code with a specific error_kind so the agent sees the cause directly. Examples returned today: The full envelope (error_kind, error_message, suggestions, and modality-specific fields such as source_url) is preserved verbatim so the agent can branch programmatically.

error_kind sub-types

Some client-side failures carry an error_kind that refines a generic code. These come from the CLI and MCP themselves, not the backend.

Timeout and wait codes

On a [timeout] for a write (create, iterate, run, delete), the backend write may have succeeded even though the response never reached the client. A naive retry creates duplicate studies, iterations, or dispatches. Verify first. The MCP timeout message names the exact verify call to run (for example, study_get(study_id=..., lean=True)), and the CLI delete timeout points you at the matching get before retrying.

Recovering by code

When a failure looks like a genuine bug (an unexpected 5xx, a fault you cannot act on), report it with ish feedback and add --health for setup or simulation issues. User-actionable failures (auth, not found, validation, billing) are never flagged as bugs.