Error Handling

Envelope-First Handling

Always parse ok first.

Common Failure Classes

  1. Discovery failure
  1. Operation not found
  1. Input validation failure
  1. Runtime transport failure
  1. OAuth authentication failure
  1. OAuth scope failure

OAuth Code Playbooks

OAUTH_REQUIRED:

  1. verify endpoint/credential mapping with binding match
  2. login with the expected credential
  3. retry original read operation

OAUTH_DISCOVERY_FAILED:

  1. check endpoint and network reachability
  2. retry login
  3. if needed, use explicit provider metadata flags supported by CLI

OAUTH_TOKEN_EXCHANGE_FAILED:

  1. ensure callback URL/code is complete and unmodified
  2. restart login flow

OAUTH_REFRESH_FAILED:

  1. retry refresh once manually
  2. if still failing, re-login (refresh token may be revoked/expired)

OAUTH_SCOPE_INSUFFICIENT:

  1. login with required scopes
  2. rerun original operation

MCP Probe Note

Retry Guidance