Skip to main content
Errors use standard HTTP status codes and a JSON body with a stable code:
Use code in your logic; message is human-readable and localized to the user’s language.

In MCP

In the MCP server, an error inside a tool is returned as a tool result with isError: true and a readable message, so the agent can correct the call (for example pick a cheaper model) and retry. Authentication errors return HTTP 401 with a WWW-Authenticate header that lets the client start the OAuth flow.