Skip to main content
When a Pleyor MCP tool fails, the response carries a typed error envelope:
{
  "code": "SCOPE_MISSING",
  "message": "trigger_run requires 'runs:execute' but the bearer carries: agents:read, runs:read",
  "next_action": "Ask the user to reconnect Pleyor and grant 'runs:execute', or use a Pleyor API key (pk_live_*) whose scope set includes runs:execute.",
  "details": {
    "tool": "trigger_run",
    "missing": ["runs:execute"],
    "present": ["agents:read", "runs:read"]
  }
}
Branch on code to recover automatically. next_action is the one-line summary you can present to the user; details carries machine-readable context.

Auth + scoping

CodeMeaningRecover by
UNAUTHORIZEDNo bearer token (or invalid)Re-run the OAuth flow (chat clients) or check the API key (pk_live_*).
SCOPE_MISSINGBearer is valid but lacks a required scopeRe-consent to add the missing scope, or use an API key whose scope set includes it. details.missing lists the gap.
ORG_NOT_BOUNDOAuth token isn’t bound to a workspaceOpen the consent flow again and pick a workspace.

Not found

CodeMeaningRecover by
AGENT_NOT_FOUNDagent_id doesn’t exist in this org (or was deleted)search({ kind: 'agents', query }) to find the right id.
RUN_NOT_FOUNDrun_id doesn’t exist (or was pruned by retention)list_runs({ agent_id }) to find a live one; if the workflow needs re-running, trigger_run again.
APP_NOT_FOUNDapp_id isn’t a published app in this orgsearch({ kind: 'apps', query }) or pleyor://apps.
NODE_TYPE_NOT_FOUNDThe type you passed isn’t a known node typeRead pleyor://nodes for the catalog.
MODEL_NOT_FOUNDThe variant_id isn’t in the model catalogRead pleyor://models or call suggest_model.
VERSION_NOT_FOUNDversion_id doesn’t exist for this agentRead pleyor://agents/{id}/versions for the list.
ASSET_NOT_FOUNDasset_id doesn’t exist or was trashedRead pleyor://assets.

Validation

CodeMeaningRecover by
INVALID_GRAPHGraph spec failed structural validationvalidate_graph returns the specific errors with next_action hints; fix and retry.
INCOMPATIBLE_PORT_TYPESEdge connects two ports of incompatible typesCheck pleyor://nodes/{type} for each end; use get_effective_ports for dynamic-arity nodes.
MISSING_REQUIRED_CONFIGA node config is missing a required fieldThe error details lists which field on which node; supply it.
INPUT_SCHEMA_MISMATCHtrigger_app inputs don’t match the app’s input_schemaRead the app’s input schema, supply the expected fields with matching types.

Execution

CodeMeaningRecover by
RATE_LIMITEDPer-org or per-client rate limit hitdetails.retry_after_seconds says how long to wait; back off and retry.
INSUFFICIENT_CREDITSOrg credit balance is below the run’s estimateTop up from your Pleyor dashboard’s billing page, or use a cheaper model (suggest_model({ use_case, budget: 'low' })).
MODEL_PROVIDER_ERRORThe upstream provider (fal.ai, OpenAI, etc.) errored mid-executiondetails.provider_error carries their message. Retry once; if persistent, swap the model variant.
RUN_ALREADY_TERMINALcancel_run called on a run that’s already completed / failed / cancelledCheck pleyor://runs/{id} for the actual status.
IDEMPOTENCY_CONFLICTSame idempotency key, different request bodyEither change the key or send the original body.

Internal

CodeMeaningRecover by
INTERNAL_ERRORSomething on our side failed unexpectedlyRetry once. If it persists, report the details.request_id.
BAD_REQUESTRequest shape is malformedRe-check the JSON-RPC envelope and tool argument types.

Recovery loop (the canonical pattern)

The pleyor-workflows skill ships an “Error recovery playbook” section that the assistant follows automatically. Roughly:
  1. Read error.code (and details.step_id for run-step failures)
  2. Branch on the code per the table above
  3. Try the suggested recovery once
  4. If recovery itself fails, surface the error to the user with the original next_action hint
For the common cases (scope missing, model error, rate limited) the agent recovers without involving you.

See also

Authentication

Scopes that drive SCOPE_MISSING.

Tools

Which tools produce which errors.