Skip to content
Docs

Errors

What the HeyBrain MCP server returns when a request or tool call fails, and what to do about each error.

Errors come back at two levels: the HTTP response to the MCP request, and the result of an individual tool call.

Connection errors#

StatusMeaningWhat to do
401 invalid_token, “Authentication required”No credential, or not sent as Authorization: Bearer ….Add the key header, or complete browser sign-in.
401 invalid_token, “The agent key is unknown, revoked or expired”The key does not work any more.Generate or rotate a key, update the tool and restart it.
503 temporarily_unavailableHeyBrain could not check the key.Retry after the Retry-After delay (5 seconds).
405A GET request. The server accepts POST only.Send JSON-RPC as POST.

Tool errors#

A failed tool call returns a result with isError: true. Its text names the failure, a code, the HTTP status and a remedy, and tells the agent not to invent an answer:

Example
Error executing tool search_documents: ERROR: search failed — Search failed [rate_limited] (HTTP 429) — Too many requests. Wait briefly, then retry with backoff.
CodeHTTPMeaning
invalid_request400, 422A parameter is missing or invalid.
unauthorized401The key expired or was revoked. Do not retry with the same key.
payment_required402Out of AI credits, a spend limit was reached, or the subscription needs attention.
forbidden403The caller’s role, plan or a governance rule does not allow it. Retrying unchanged will not help.
not_found404No such item, or the caller cannot access it.
conflict409Usually held for approval. See below.
payload_too_large413The input is too large.
rate_limited429Too many calls. The server retries once, honoring Retry-After, before returning this.
server_error5xxRetry once. If it repeats, report it.
timeout, unreachable–HeyBrain did not answer in time.

Specific codes#

Some failures add a specific code after the general one, for example [forbidden:PLAN_LIMIT_REACHED].

CodeMeaning
PLAN_LIMIT_REACHEDYour plan’s limit for this resource is reached. See Plans and limits.
DLP_BLOCKEDThe content matched a data-loss-prevention rule, for example a secret, and was not saved.
DLP_SCAN_UNAVAILABLEThe content could not be scanned, so it was not saved. Retry later.
STORAGE_FULLYour storage is full.
ALLOWANCE_EXHAUSTED, SPEND_LIMIT_REACHED, SPEND_FROZEN, SUBSCRIPTION_PAST_DUECredits or billing need attention in the dashboard.
AGENT_ACTION_HELDThe action needs approval. See below.
APPROVAL_TICKET_REJECTEDThe approval ticket was rejected, expired or already used.

Held for approval#

When a governance rule requires approval, a write returns [conflict:AGENT_ACTION_HELD] with a ticket id. After someone approves it, call the same tool again with approval_ticket set to that id. A ticket works once, within 24 hours.

Sign-in (OAuth) errors#

The authorization server returns standard OAuth errors as { "error", "error_description" }, for example invalid_grant, invalid_scope or access_denied. Errors during authorization redirect back to the client when its redirect URI is verified, and otherwise show an error page.

Note: Error details are capped at 500 characters, and anything that looks like a key is redacted before it reaches the agent.

Last checked against the product on November 25, 2026.