Error Handling
Envelope-First Handling
Always parse ok first.
ok=true: consumedataok=false: branch byerror.code
Common Failure Classes
- Discovery failure
- Symptoms:
listfails, protocol not detected, endpoint mismatch - Actions:
- verify host URL/scheme/port
- run with
RUST_LOG=debug - for OpenAPI schema separation, provide
--schema-urlor mapping if needed
- Operation not found
- Symptoms: operation help or runtime call reports unknown operation
- Actions:
- refresh with
-hon endpoint - check exact operation naming convention per protocol
- refresh with
- Input validation failure
- Symptoms: invalid argument / missing field
- Actions:
- inspect operation schema via
<operation> -h - start from minimal required payload
- prefer
key=valueor bare positional JSON for primary calls
- inspect operation schema via
- Runtime transport failure
- Symptoms: timeout, connection reset, TLS error
- Actions:
- retry with bounded attempts
- verify endpoint health with native tooling (
curl,grpcurl)
- OAuth authentication failure
- Symptoms:
OAUTH_REQUIRED,OAUTH_REFRESH_FAILED,401 invalid_token - Actions:
- verify binding with
uxc auth binding match <endpoint> - inspect credential with
uxc auth oauth info <credential_id> - run
uxc auth oauth refresh <credential_id> - if refresh fails, run login again
- verify binding with
- OAuth scope failure
- Symptoms:
OAUTH_SCOPE_INSUFFICIENT, HTTP403 - Actions:
- login again with broader scopes
- confirm provider/workspace policy grants requested scopes
OAuth Code Playbooks
OAUTH_REQUIRED:
- verify endpoint/credential mapping with binding match
- login with the expected credential
- retry original read operation
OAUTH_DISCOVERY_FAILED:
- check endpoint and network reachability
- retry login
- if needed, use explicit provider metadata flags supported by CLI
OAUTH_TOKEN_EXCHANGE_FAILED:
- ensure callback URL/code is complete and unmodified
- restart login flow
OAUTH_REFRESH_FAILED:
- retry refresh once manually
- if still failing, re-login (refresh token may be revoked/expired)
OAUTH_SCOPE_INSUFFICIENT:
- login with required scopes
- rerun original operation
MCP Probe Note
- For MCP HTTP endpoints,
uxcmay refresh OAuth during protocol probe when probe receives401. - If refresh still fails, expect OAuth-related errors instead of a generic protocol mismatch.
Retry Guidance
- Retry only idempotent read-like operations by default.
- Suggested backoff: 1s, 2s, 4s (max 3 attempts).
- Do not retry validation errors without payload change.