# Error codes · what they mean

Xale's MCP server answers in two layers: protocol errors (HTTP status and a JSON-RPC `error`) and tool errors (a normal result with `isError: true`). The OAuth endpoints answer with standard OAuth error codes. Look up the message you got below.

Checked 2026-12-02 · https://xale.app/docs/ai/error-codes-what-they-mean

## Two layers

- **Protocol errors** come back as a JSON-RPC `error` object, `{ "code": …, "message": "…" }`, often with an HTTP status other than 200.
- **Tool errors** come back as a normal `tools/call` `result` with `isError: true` and one plain sentence in `content[0].text`. See [Tool errors · shared shapes](https://xale.app/docs/ai/tool-errors-shared-shapes).

## HTTP and JSON-RPC errors

| HTTP | Code | Message | What to do |
| --- | --- | --- | --- |
| `401` | `-32001` | "Sign in to Xale to use this connector." | Start OAuth from the `WWW-Authenticate` header. With a token that's expired, revoked or wrong, the header adds `error="invalid_token"` and "Connect the app to Xale again." |
| `403` | `-32600` | "This origin may not call Xale's MCP server." | A browser call from an origin Xale doesn't accept. Call from your server, or from loopback. |
| `400` | `-32600` | "Unsupported MCP-Protocol-Version. Supported: 2025-11-25, 2025-06-18." | Send a supported version. |
| `400` | `-32600` | "Batches are not supported; send one message per POST." | One message per POST. |
| `400` | `-32600` | "Not a valid JSON-RPC 2.0 message." | Check `jsonrpc`, `method`, `params` and `id`. |
| `400` | `-32600` | "{method} is a request and needs an id." | Only `notifications/…` may leave out `id`. |
| `400` | `-32700` | "Parse error." or "The request body couldn't be read." | Send valid JSON. |
| `413` | `-32600` | "This request is over Xale's 256 KB limit. …" | Split it: see [Size limits](https://xale.app/docs/ai/size-limits-notes-maps-calls). |
| `429` | `-32000` | "Too many requests on this connection. Try again in a minute." | Wait 60 seconds (`Retry-After: 60`). |
| `429` | `-32000` | "Too many requests. Try again in a minute." | Wait 60 seconds. |
| `503` | `-32000` | "Xale is temporarily unavailable. Try again shortly." | Retry shortly. |
| `405` |  | No body, `Allow: POST, OPTIONS` | Use `POST` only: the server is stateless. |

A notification is accepted with `202` and no body.

## Errors inside a `200`

| Code | Message |
| --- | --- |
| `-32601` | "Method not found: {method}" |
| `-32602` | "Unknown tool: {name}" |
| `-32602` | "Unknown prompt." |
| `-32002` | "Resource not found." |

## Tool error texts to recognise

| Starts with | Means |
| --- | --- |
| "This connection wasn't given permission to …" | The scope is missing. The person reconnects and leaves that permission ticked. |
| "Xale's AI connector needs Xale Pro." | See [Pro required](https://xale.app/docs/ai/pro-required-what-happens). |
| "Invalid arguments for {tool}: check …" | Up to five fields, each with its rule; your values are never repeated. |
| "Invalid arguments for {tool}: … must be a single id from another Xale tool." | An id field holds something other than one id. |
| "Nothing with that id is available in this Xale." | Missing, in Trash or kept away. See [Hidden items](https://xale.app/docs/ai/hidden-items-trash-and-kept-away-areas). |
| "This call is still being made." / "Xale can't tell whether an earlier call…" / "This requestId was already used for different content…" | `requestId` states. See [Request ids](https://xale.app/docs/ai/request-ids-safe-retries). |
| "… (ref 1a2b3c4d)" | An internal failure, with a reference. For a read: "Xale couldn't complete that. Try again shortly (ref …)." For a write: see [Partial saves](https://xale.app/docs/ai/partial-saves-what-to-tell-people). |

## OAuth errors

The registration, token and revocation endpoints answer `{ "error": "…", "error_description": "…" }`, usually with HTTP `400`.

| `error` | Example `error_description` |
| --- | --- |
| `invalid_request` | "The parameter … appears more than once." |
| `invalid_client` | "Unknown client." |
| `invalid_grant` | "The authorization code expired. Connect again." · "The refresh token was already used." · "This connection was removed. Connect the app to Xale again." · "This Xale account can't be used right now." |
| `invalid_scope` | On refresh: "Not supported: …" or "The requested scope was not granted." |
| `invalid_target` | "Wrong resource." |
| `unsupported_grant_type` | "Use authorization_code or refresh_token." |
| `invalid_redirect_uri` | A return address that isn't an accepted app callback or loopback |
| `invalid_client_metadata` | A registration Xale can't accept |
| `slow_down` (`429`) | "Too many requests. Try again in a minute." |
| `temporarily_unavailable` (`503`) | "Xale couldn't complete that. Try again shortly." |

Token lifetimes and refresh: [Tokens · expiry and refresh](https://xale.app/docs/ai/tokens-expiry-and-refresh).

## Related

- For people: [Why can't my AI find Xale?](https://xale.app/help/ai-can-t-find-xale-fixes)
- For people: [Why does Xale keep asking me to sign in when I connect Claude?](https://xale.app/help/sign-in-loop-when-connecting)
- Read next: [Tool errors · shared shapes](https://xale.app/docs/ai/tool-errors-shared-shapes)
- Read next: [Refusals · how to fix](https://xale.app/docs/ai/refusals-how-to-fix)
- Read next: [Tokens · expiry and refresh](https://xale.app/docs/ai/tokens-expiry-and-refresh)
