Agent errors
Updated 2026-11-13
This page lists every error code an agent can get from the account address https://spreadapi.io/mcp: what it means, what the agent should do, and what it should tell its user.
How an error looks
Every answer of an action has the same form. A failure looks like this:
{ "ok": false,
"action": "set_parameters",
"error": {
"code": "invalid_parameters",
"message": "… Nothing was saved.",
"problems": [ { "code": "…", "at": "…", "message": "Loan!B5 contains a formula. …" } ]
} }error.codeis one of the codes below. The codes are stable; decide by the code, not by the wording of the message.error.messagesays in plain words what is wrong. It is safe to pass on to the user.error.problems, when present, names each field or parameter withatand amessage.error.options, when present, lists next calls that are ready to send (action,why,call).error.retry_after(fortoo_fast) is the number of seconds to wait.
Over MCP an error arrives in one of two ways:
- A missing or invalid connection answers HTTP 401 with a
WWW-Authenticateheader, before any action runs. This is what lets a client start its sign-in. - Every other error is a normal tool result with
isError: true; the envelope above is instructuredContentand, as text, incontent.
All codes
Connection
Over MCP, key_required and key_invalid reach the client as the HTTP 401 answer described above, with the reason in the message.
| Code | Means | What the agent does | What to tell the user |
|---|---|---|---|
key_required | No connection was presented. | Start the sign-in if the client supports it, or ask for a key. | "I need a SpreadAPI connection. You create one on the AI agents page." |
key_invalid | The key was revoked or mistyped. The same applies to an expired connection, an ended sign-in, and while AI access is switched off for the account. | Sign in again, or ask for a new connection. Do not retry with the same key. | "My SpreadAPI connection is no longer valid. Please check it on the AI agents page or create a new one." |
right_missing | The connection may not do this (run, create or change, or publish services). | Stop. Do not work around it. | "My connection may not do this. You can change that on the AI agents page." |
Finding things
| Code | Means | What the agent does | What to tell the user |
|---|---|---|---|
unknown_action | There is no action with this name. | Call what_can_you_do for the list. | nothing |
service_not_found | No such service for this connection: the id is wrong, the service belongs to another account, or it is not on the connection's list. | Call list_services and use an id from it. | If the service is missing from the list: "This service is not shared with my connection." |
not_published | The action needs a published service; this one is a draft. | Use test_service to calculate on the draft, or publish_service if the user wants it public. Both are offered in options. | Ask before publishing. |
workbook_not_readable | The workbook was last saved in the editor, in a form the agent connection cannot read. | Do not retry. The service can still be run, renamed, described and protected. | "This workbook was saved in the editor; I cannot read or change its cells and parameters. Please continue in the app." |
Input
| Code | Means | What the agent does | What to tell the user |
|---|---|---|---|
invalid_input | The arguments do not fit the action; problems names each field. Nothing was done. | Fix the arguments and send again. | nothing |
invalid_workbook | The workbook cannot be read; the message says why. | Fix the workbook and send again. | Only if the user's file itself is the problem. |
invalid_parameters | Inputs or outputs do not fit the workbook; problems names each one. Nothing was saved. | Fix them and send again, for example use a cell without a formula as an input. | nothing, unless the user must choose the cells |
invalid_values | Input values were rejected (missing, out of range, not allowed); problems names each input. | Fix the values and send again. If the user asked for a value that is not allowed, say what is allowed instead of picking another one. | "This value is not allowed; allowed is …" |
Limits
| Code | Means | What the agent does | What to tell the user |
|---|---|---|---|
publish_limit | The plan of the account does not allow another published service. The draft stays. | Stop. Do not unpublish anything on your own. | "Your plan's number of published services is reached. Unpublish another service or upgrade, then I can publish." |
call_limit_reached | The account has used its calls for this month. | Do not retry. | "The calls for this month are used up. Calls work again on the 1st of next month (UTC) or after an upgrade." |
data_source_unavailable | A data source of the workbook could not be read, or cannot be added; the message names it and says why. | Fix the address if it is wrong. If the data source was only briefly down, try again later. | "The data source … cannot be read right now." with the reason from the message. |
workbook_too_large | The workbook is over the size limit of the plan; the message names the limit. | Make the workbook smaller, or stop. | "The workbook is larger than your plan allows." |
too_fast | Too many calls in a minute; retry_after is in seconds. | Wait, then send the same call again. | nothing |
Our side
| Code | Means | What the agent does | What to tell the user |
|---|---|---|---|
failed | An error on our side, not caused by the input. | Try again later with the same request. Do not change the request. | If it stays: "SpreadAPI reported an error on its side." |
Which action can return which code
Every action that needs a connection can return key_required, key_invalid, right_missing, invalid_input, too_fast and failed. In addition:
| Action | Additional codes |
|---|---|
what_can_you_do | none (it works without a connection; only invalid_input and failed) |
list_services | none |
describe_service | service_not_found |
describe_workbook | service_not_found, workbook_not_readable, data_source_unavailable |
read_cells | service_not_found, workbook_not_readable, data_source_unavailable |
create_service | invalid_workbook, workbook_too_large, invalid_parameters, data_source_unavailable |
set_parameters | service_not_found, workbook_not_readable, invalid_parameters, data_source_unavailable |
update_service | service_not_found, workbook_not_readable, data_source_unavailable |
test_service | service_not_found, workbook_not_readable, invalid_values, data_source_unavailable |
publish_service | service_not_found, workbook_not_readable, invalid_parameters, publish_limit, data_source_unavailable |
run_service | service_not_found, not_published, invalid_values, call_limit_reached, data_source_unavailable |
Typical cases
- `invalid_input` on `create_service`: send exactly one of
sheetsandxlsx_base64. A file that is too long forxlsx_base64is refused the same way; send the cells assheetsinstead. - `invalid_input` on `update_service`: at least one field besides
service_idis required. - `invalid_input` on `read_cells`: the sheet or range could not be read; check the sheet name with
describe_workbook. - `invalid_parameters` on `set_parameters`: an input must be one cell without a formula; an output is a cell or range. Read the
problems, correct the addresses and send all inputs and outputs again, because the call replaces all of them. - `invalid_values` on `test_service` or `run_service`: each problem has
atsuch asinputs.license_typeand says what is allowed. A missing required input has the problem codemissing. - `not_published` on `run_service`: use
test_servicefor a draft.
Warnings are not errors
A successful answer can carry warnings: things that worked but deserve a look, for example after set_parameters or publish_service. Read them and pass on what matters to the user.
For people: where refused calls show up
The AI agents (KI-Agenten) page lists refused calls under Recent activity (Letzte Aktivität) with the reason in words, for example "was refused: the connection may not do this" or "was refused: the service is a draft", and counts them under Refused calls (Abgelehnte Aufrufe). See The AI agents page.
Related: Rights and limits of a connection, AI troubleshooting, and for the errors of a service's own API Error reference.
For developers and agents
- The codes:
key_required,key_invalid,right_missing,unknown_action,service_not_found,not_published,workbook_not_readable,invalid_input,invalid_workbook,invalid_parameters,invalid_values,publish_limit,call_limit_reached,workbook_too_large,too_fast,failed. what_can_you_dowithguide: "errors"returns the same list as one text.- HTTP 401 answers carry a JSON-RPC error with code
-32001and a message such as "This key is not valid (revoked or mistyped)." or "The sign-in has expired or was withdrawn. Sign in again." key_requiredcarriesconnect_url, the page where the account owner creates a connection.- Retry rules: retry unchanged after
too_fast(afterretry_afterseconds) and afterfailed(later). Retry after a fix for the fourinvalid_…codes. Do not retryright_missing,publish_limit,call_limit_reachedorworkbook_not_readable.
FAQ
What error codes can the SpreadAPI agent connection return?
Sixteen: key_required, key_invalid, right_missing, unknown_action, service_not_found, not_published, workbook_not_readable, invalid_input, invalid_workbook, invalid_parameters, invalid_values, publish_limit, call_limit_reached, workbook_too_large, too_fast and failed.
As an agent, what do I do when I get right_missing?
Stop and tell your user that the connection may not do this and that the account owner can change it on the AI agents page. Do not try to reach the same result another way.
As an agent, what does service_not_found mean when the user says the service exists?
The service is not on your connection's list, belongs to another account, or the id is wrong. Call list_services; if it is missing there, ask the user to share the service with your connection.
As an agent, should I retry after too_fast?
Yes. Wait the number of seconds in retry_after, then send the same call again unchanged.
As an agent, should I retry after failed?
Try again later with the same request and do not change it, because the error is not caused by your input. If it stays, tell your user.
As an agent, what do I do at publish_limit?
Tell the user that the plan does not allow another published service and that they can unpublish another one or upgrade. Never unpublish anything on your own; the draft stays as it is.
As an agent, what do I do at call_limit_reached?
Do not retry. Tell the user that the month's calls are used up and that calls work again on the 1st of next month (UTC) or after an upgrade.
What does workbook_not_readable mean?
The workbook of the service was last saved in the editor, and the agent connection cannot read its cells. The service can still be run and its name, texts and token protection changed; cells and parameters are edited in the app.
What is the difference between invalid_input, invalid_parameters and invalid_values?
invalid_input means the arguments of the call do not fit the action. invalid_parameters means the chosen input or output cells do not fit the workbook, and invalid_values means input values for a calculation were rejected.
Why did my agent get an HTTP 401 instead of an error code?
A missing or invalid connection is answered with HTTP 401 before any action runs, so that an AI client can start its sign-in. All other errors come as a tool result with isError: true.
Where do I see why my agent was refused?
On the AI agents page under Recent activity: each refused call is listed with the connection, the time and the reason in words.
Was anything changed when a call fails?
No. A refused set_parameters saves nothing, a refused publish_service leaves the service as it was, and invalid_input means nothing was done.