Reference
Errors
Error format, every error code, and tool errors vs gateway errors.
Error format
Every non-2xx response from the REST API has the same body:
Response · 403
{
"error": {
"code": "tool_disabled",
"message": "`github.create_issue` is turned off in the dashboard."
}
}Branch on code, which is stable. message is for people and may change.
Gateway errors vs tool errors
- Gateway error (HTTP 4xx/5xx): the tool didn't run, or the server couldn't be reached.
- Tool error (HTTP 200,
result.isError: true): the tool ran and reported a failure, such as "repository not found". The text is inresult.content.
Over the MCP endpoint, gateway errors during a tool call are also returned as tool results with isError: true, so the model can read them.
All error codes
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_json | The body isn't valid JSON. |
| 400 | invalid_request | Bad tool name or arguments, e.g. arguments isn't an object. |
| 401 | missing_api_key | No Authorization header, or it isn't a Bearer key. |
| 401 | invalid_api_key | Unknown, revoked, or not a Portless key. |
| 403 | tool_disabled | The tool is turned off in the dashboard. |
| 404 | tool_not_found | No tool with that name in this workspace. |
| 404 | server_not_found | No server with that id in this workspace. |
| 405 | method_not_allowed | GET or DELETE on the stateless MCP endpoint. |
| 422 | invalid_endpoint | The server's URL isn't a valid http(s) URL. |
| 422 | endpoint_not_allowed | The server's URL points at a private or local address. |
| 500 | credentials_unavailable | Saved credentials can't be decrypted. Save them again. |
| 500 | internal_error | Unexpected gateway error. Safe to retry reads. |
| 501 | transport_not_supported | The server uses stdio, which the hosted gateway can't start. |
| 502 | upstream_error | The MCP server failed, timed out, or rejected the gateway. |
| 502 | upstream_unreachable | The server's host name couldn't be resolved. |
Retrying
- Reads (
GET) can be retried on502,503,504and network errors, with backoff. - Don't retry tool calls blindly: the upstream may have done the work before the error. Retry only tools you know are safe to repeat.
- Never retry
4xxor501without changing something first.