/Platform

Errors, limits & retries

What comes back when a call does not work, and what to do about it. Probed against the live servers rather than written from a spec, including the parts that are currently rough.


Two shapes of failure

This trips people up more than anything else here, so handle both from day one.

Protocol errorsA JSON-RPC error object. The request never reached a tool — bad JSON, unknown method, unknown tool name.
Tool errorsAn HTTP 200 with a result carrying isError: true. The tool ran and refused. This is the MCP convention and it is easy to miss: a 200 is not success. If you only check error, you will treat every refusal as a win.
// Both must be handled.
const res = await call('stories.list', {})
if (res.error) throw new Error(res.error.message)          // protocol
if (res.result?.isError) handleToolFailure(res.result)     // tool refused

Protocol error codes

CodeMeaningNotes
-32700Parse errorYour JSON was malformed. Both servers return this with id: null.
-32601Method not foundThe JSON-RPC method does not exist. Valid methods: initialize, tools/list, tools/call, ping.
-32602Invalid paramsOn Storytailor MCP this is an unknown tool name, and the response carries availableTools plus a didYouMean array worth showing in your own error output.
-32600Invalid requestA structurally invalid payload. An empty body, or a shape that is not JSON-RPC.
-32001Authentication requiredServer-defined. A well-formed call whose credential is missing, malformed or wrong. Branch on the code, not the message text, and never retry without changing the key.

Both servers now behave the same way

Until 2026-08-30 Story Intelligence collapsed every unauthenticated failure into one -32600, so an unknown method, a typo’d tool name and a valid call were indistinguishable. Fixed: the request is validated before the credential is checked, and each of the three is answered on its own terms. If you built a workaround for the old behavior, remove it.


Tool errors

AUTH_TOKEN_INVALIDThe bearer token is wrong or expired. Re-authenticate; do not retry with the same token.
Missing authenticationThe tool needs a user and none was supplied. The message names the tool and how to supply one.
Validation messagesA required argument was absent, for example “email required”. Fix the call; retrying will not help.
402 / quotaOn Storytailor MCP this means the USER hit their plan ceiling, not that your integration broke. Show their real plan and limit; the subscription tools return both.

Rate limits

Limits are enforced per organization and scale with your plan, and every authenticated response tells you where you stand, so you never have to find a limit by hitting it.

RateLimit-Limit:     3     # calls allowed in the window
RateLimit-Remaining: 2     # calls left, never below zero
RateLimit-Reset:     41    # seconds until the window resets
Retry-After:         41    # present only when you are over

Field names follow the IETF RateLimit draft, and are exposed via CORS so browser-side code can actually read them. Unauthenticated calls carry no headers, having no budget to report.

RetryTransport failures and 5xx only. Exponential backoff with jitter, capped at five attempts.
Never retry-32602, validation failures, AUTH_TOKEN_INVALID, quota refusals, or any safety refusal. Nothing about the second attempt differs from the first, and retrying a safety refusal is the one that will lose you access.
Never retry blindGeneration is asynchronous. If compose times out on your side the work may still be running, poll status before starting again, or you will pay for two.
IdempotencyGeneration calls are not idempotent. Hold your own request key and check status before re-issuing.

Sign in with Storytailor errors

Different product, different rules. SIWS is a standard OIDC provider, so it speaks OAuth error codes rather than the JSON-RPC ones above, and it returns them as { "error", "message" } — note message, not the spec’s error_description. Read the code, not the key.

CodeHTTPWhat actually happened
client_not_active403The one you will hit first. Every client is created pending and only an explicit activation makes it active. Nothing is wrong with your request — the app has not been switched on yet. This fails closed on purpose, so a client can never serve families before someone deliberately turns it on.
invalid_client400Unknown client_id, or a secret that does not match it.
invalid_grant400The authorization code is expired, already spent, or does not match your redirect_uri or PKCE verifier. Replaying a used code revokes every token minted from it (RFC 6749 §4.1.2) — a replay is treated as theft, not as a retry, so never retry a token exchange with the same code.
invalid_request400A required parameter is missing or malformed.
unsupported_grant_type400Only authorization_code and refresh_token are supported.
access_denied—The parent declined at the consent screen. Not a fault: it is the product working. Return them somewhere kind and do not retry automatically.
server_error500Ours. Safe to retry once with backoff.

There is no per-tool rate limit here because there are no tools — the limits that apply are the ordinary ones on the authorize and token endpoints, and a normal sign-in never approaches them.

Safety refusals are not errors

A refused generation is the system working. Do not retry it, do not reword the prompt to get around it, and do not build a fallback that serves unchecked content when a check fails. Fail closed: no story is always the correct outcome over an unchecked one. Show the person something calm and true, and never show a child a stack trace.


Errors, limits & retries · Storytailor Platform