Skip to content

Commerce MCP

Limits and errors

How much you can call, what the errors mean, and how fresh the data is.

Rate limits#

Sliding one-minute windows. These are the defaults; Aiptimise can set other values for your consumer.
CallerLimitCounted per
API keys600 requests / minuteConsumer, across all its keys
Sandbox consumers60 requests / minuteConsumer, across all its keys
Directory endpoints (anonymous)60 requests / minuteClient IP address, per platform
Directory endpoints (anonymous)3000 requests / minuteAll anonymous callers of one platform together
OAuth sign-in120 requests / minuteSigned-in user
Console playground30 requests / minuteConsumer

A consumer can also have a daily cap covering its keyed and anonymous calls. Your console Overview shows the limits that apply to you. Over any limit, the response is HTTP 429 with Retry-After in seconds.

HTTP errors#

Answered before any tool runs, with a JSON body { "error": "…" }.
StatuserrorWhenHeaders
401authentication_requiredNo credential was sent to an endpoint that needs one: /api/mcp without a key, or a directory endpoint that is not open to anonymous calls.WWW-Authenticate: Bearer resource_metadata="…"
401invalid_tokenThe API key is malformed, unknown, revoked or expired, or the OAuth access token is invalid or no longer honored (client, membership or consumer changed).WWW-Authenticate: Bearer resource_metadata="…", error="invalid_token"
403consumer_suspendedThe key is valid but its consumer is not active (pending, suspended or revoked).
403consumer_mismatchThe key belongs to another consumer than the /api/mcp/p/{slug} path it was sent to. Send keys to /api/mcp.
403origin_not_allowedA browser sent an Origin that is not an Aiptimise site or a known AI client app (the MCP transport rules require refusing it). Server-side clients send no Origin and are unaffected.
403insufficient_scopeAn OAuth call used a tool whose scope your consumer has but the token lacks. The body's error_description is "Allow this app to access this data on Aiptimise to use this tool"; re-authorize with the scopes named in the challenge.WWW-Authenticate: Bearer resource_metadata="…", error="insufficient_scope", scope="…"
404unknown_endpointThere is no directory endpoint /api/mcp/p/{slug} with that slug.
405method_not_allowedA GET or DELETE: the server is stateless, with no server-to-client stream and no session. Send every message as a POST.Allow: POST
429rate_limit_exceededA rate limit was reached. Wait the number of seconds in Retry-After, then retry.Retry-After: <seconds>
503mcp_unavailableThe service is switched off by Aiptimise, or rate limiting is unavailable (the service fails closed rather than serve unmetered). Retry later.
Example: an invalid key on /api/mcp
HTTP 401
content-type: application/json
www-authenticate: Bearer resource_metadata="https://app.aiptimise.com/.well-known/oauth-protected-resource/api/mcp", error="invalid_token"
x-request-id: <uuid>

{
  "error": "invalid_token"
}

resource_metadata in WWW-Authenticate points OAuth clients to the sign-in metadata (see Authentication and access). ChatGPT only offers sign-in when the challenge arrives in a tool result, so a call carrying ChatGPT's openai/* request _meta gets the same challenge that way instead (HTTP 200):

JSON
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "isError": true,
    "content": [
      {
        "type": "text",
        "text": "Allow this app to access this data on Aiptimise to use this tool."
      }
    ],
    "_meta": {
      "mcp/www_authenticate": [
        "Bearer resource_metadata=\"https://app.aiptimise.com/.well-known/oauth-protected-resource/api/mcp/p/openai\", error=\"insufficient_scope\", error_description=\"Allow this app to access this data on Aiptimise to use this tool\", scope=\"catalog:read offers:read\""
      ]
    }
  }
}

No tool requires sign-in today, so the sign-in form of this challenge (“Sign in to Aiptimise to use this tool”) is not sent; only OAuth callers can get the step-up form above.

Protocol errors#

Standard JSON-RPC errors from the MCP transport.
CaseHTTPJSON-RPC code
Body is not valid JSON400-32700 Parse error: Invalid JSON
accept header lacks application/json or text/event-stream406-32000 Not Acceptable: Client must accept both application/json and text/event-stream
Unknown method (for example resources/list)200-32601 Method not found
The tool does not exist, or your scopes do not include it200-32602 Tool place_order not found
Unsupported protocol version (error.data.supported lists the ones to retry with)400-32022 Unsupported protocol version: 2099-01-01

Tool errors#

HTTP 200 with result.isError: true. content[0].text is JSON: { "error": { code, message, retryable, next_tool?, details? } }. Branch on code; show the shopper a plain explanation, not the message verbatim.

A refused call has no structuredContent: MCP clients validate it against the tool's output schema even on errors. Example, get_live_price_and_inventory without variant_id for a product sold in several variants:

JSON
{
  "error": {
    "code": "variant_required",
    "message": "This product has 4 variants. Choose one with get_product_variants, then pass its variant_id.",
    "retryable": false,
    "next_tool": "get_product_variants",
    "details": {
      "variant_count": 4
    }
  }
}
codeWhenretryablenext_tool
not_availableThe store or product does not exist, is not served to you, belongs to another store, or is in a restricted category. The answer is the same in every case, so IDs cannot be probed.false
variant_requiredget_live_price_and_inventory was called without variant_id for a product sold in several variants. details.variant_count says how many.falseget_product_variants
invalid_argumentsAn argument is missing, has the wrong type or is out of range. details.path names the first offending argument; the tool's inputSchema describes them all.false
product_requiredvariant_id was passed without the product_id it belongs to.false
store_requiredget_store_info needs exactly one of store_id and store_domain.false
search_unboundedsearch_products was called with neither a query nor a filter.false
currency_requiredmin_price or max_price was passed without currency.false
price_range_invalidmin_price is above max_price.false
too_many_attributesMore than 10 attribute or option filters were passed.false
internal_errorAn unexpected failure. Retry later, and quote the X-Request-Id response header if it persists.true

retryable: false means the same call will fail again: change the arguments or stop. next_tool is only named when your scopes include that tool. not_available reads “The requested store or product is not available.” whatever the cause, so do not retry it with guessed IDs.

Freshness: as_of, source and valid_until#

  • Search results and variants report price and availability from the last catalog sync; each search result and each page of variants has its as_of time.
  • get_live_price_and_inventory returns source: live when it read the merchant's platform just now, or snapshot when it used the last catalog sync. Live reads are supported for Shopify stores; if one takes longer than 700 ms, the snapshot is returned instead.
  • A live offer has as_of and valid_until, 30 seconds later. The same offer is served from cache until then. Do not show it after valid_until; call again.
  • Show prices with their as_of time. The data-use terms set how long you may cache catalog content.