Browse and search developers
MCP server
MCP errors and limits
The error shapes FormitAI returns over MCP (HTTP 401, OAuth errors, tool errors) and the rate limits that apply to MCP mutations.
FormitAI reports MCP problems at three levels. Authentication failures are HTTP errors on the endpoint itself. OAuth problems use the standard OAuth error JSON. Problems inside a tool call come back as a normal MCP tool result with isError: true and a JSON payload your client or model can act on. This page describes each shape and the rate limits that apply.
HTTP 401 from the MCP endpoint
A request with no bearer token, an unknown, expired or revoked API key, or an OAuth token that is invalid, expired or for another resource gets the same response. The WWW-Authenticate header is how OAuth clients find out where to sign in.
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer realm="mcp", resource_metadata="https://api.formitai.com/.well-known/oauth-protected-resource"
{"error":"UNAUTHORIZED","message":"Provide a Formit API key or MCP OAuth access token"}A 401 also happens when an OAuth token’s user has left the workspace, or when you send an x-formit-workspace header that does not match the token’s workspace. Fix the credential before you retry: repeating the same request will fail the same way.
OAuth errors
The /register, /authorize and /token endpoints return {"error": "...", "error_description": "..."} using the OAuth error codes invalid_request, invalid_client, invalid_grant, unsupported_grant_type, unsupported_response_type, invalid_target, invalid_redirect_uri and access_denied. /token responds 401 for invalid_client and 400 for the rest. Once the redirect URI has been validated, /authorize sends errors back to it as query parameters (with state and iss) instead of showing them.
{
"error": "invalid_grant",
"error_description": "Refresh token reuse detected"
}Tool errors
When a tool fails, the HTTP request still succeeds. The MCP result has isError: true and one text content item holding a JSON object:
| Field | Type | Meaning |
|---|---|---|
error | string | A short message you can show to a person. |
recoverable | boolean | true only for logic and branching validation errors, which the model should fix and retry in the same turn. When false, stop and do not repeat the same call. |
code | string, optional | A machine-readable code such as NOT_FOUND, FORBIDDEN, BAD_REQUEST, RATE_LIMITED, or a logic wiring code. |
hint | string, optional | How to fix a logic rule. |
allowed | string[], optional | Valid values when an argument was out of range. |
details | object, optional | Logic validation detail: unknown, errors, operator, fieldType, questionId. |
{
"content": [
{
"type": "text",
"text": "{\"error\":\"Missing permission: workspace.forms.publish\",\"recoverable\":false,\"code\":\"FORBIDDEN\"}"
}
],
"isError": true
}NOT_FOUND: the form, question or block type does not exist in this workspace. IDs from other workspaces always look like this.FORBIDDEN: the credential’s role does not have the permission. The message names it, for exampleworkspace.forms.write.BAD_REQUEST: the arguments are valid JSON but not allowed, for example a destructive tool called withoutconfirm: true, or a choice block with fewer than 2 options.PAID_FEATURE_REQUIRED: the form uses paid features the organization’s plan does not cover, with a message such as "Upgrade required to publish: …". Runvalidate_publishfirst to seeblockedFeaturesandsuggestedPlan.
Rate limits
| Limit | Applies to | Scope | Window |
|---|---|---|---|
| 120 calls | Every mutating MCP tool, including webhook tools | Per workspace, shared by all keys and OAuth tokens | Rolling 1 hour |
| 2 calls | create_form and duplicate_form (on top of the limit above) | Per organization | Rolling 1 second |
Read-only tools such as list_forms, get_form and validate_publish do not count toward the mutation limit. A mutating call counts as soon as its arguments and form ID check out, even if it then fails a permission or plan check. Over the limit, the tool returns code: "RATE_LIMITED" with error: "Too many requests", or a message saying how many forms you can create per second.
To stay under the limit, plan the whole form before writing it, add only the questions you need, and avoid update loops. If you hit RATE_LIMITED, wait before retrying. The window rolls, so capacity comes back gradually as older calls age out.
Related
Can't find what you need?