Skip to main content
Decide with the code, not the message: the text can change.

Shape

A tool error carries message (for a person), next (what to do) and retryable. It also carries Recovery:, one sentence telling the agent what to do, and Request id:. If retryable is false, fix what it says before calling again. Keep the request_id when asking for help. The REST API returns this shape:
  • fixer says who fixes it: caller (fix the request), person (a person has to act, such as saying yes or reconnecting) or brein (our failure; try again later).
  • recovery is the next step, in one sentence.
  • A 403 may carry reason, the exact cause: for example api_key_member_removed (whoever created the key is no longer a member) or oauth_workspace_mismatch (the token belongs to another workspace). The code stays FORBIDDEN.
A Form 422 adds errors: one entry per question, with key or path and message.

Common codes

Tool cases

Without balance or on a plan that does not include it, Brein fails closed with 402. There is no automatic retry with another provider.