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.

On this page
  1. HTTP 401 from the MCP endpoint
  2. OAuth errors
  3. Tool errors
  4. Rate limits

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
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.

JSON
{
  "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:

FieldTypeMeaning
errorstringA short message you can show to a person.
recoverablebooleantrue 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.
codestring, optionalA machine-readable code such as NOT_FOUND, FORBIDDEN, BAD_REQUEST, RATE_LIMITED, or a logic wiring code.
hintstring, optionalHow to fix a logic rule.
allowedstring[], optionalValid values when an argument was out of range.
detailsobject, optionalLogic validation detail: unknown, errors, operator, fieldType, questionId.
JSON
{
  "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 example workspace.forms.write.
  • BAD_REQUEST: the arguments are valid JSON but not allowed, for example a destructive tool called without confirm: 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: …". Run validate_publish first to see blockedFeatures and suggestedPlan.

Rate limits

LimitApplies toScopeWindow
120 callsEvery mutating MCP tool, including webhook toolsPer workspace, shared by all keys and OAuth tokensRolling 1 hour
2 callscreate_form and duplicate_form (on top of the limit above)Per organizationRolling 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.

Ready?

Build your first AI form in minutes.

No credit card. Generate from a prompt, enable follow-ups, and publish a link or embed the same day.