BC Data docs

Errors

The error shape and every error code the BC Data REST API and MCP server return.

Shape

Every REST error is JSON with an HTTP status:

{ "error": { "code": "rate_limited", "message": "Too many requests.", "retry_after_seconds": 41, "window": "minute" } }

A tool that cannot answer returns available: false, an error with a code and a message, and citations: [], the same as over MCP:

{ "available": false, "error": { "code": "not_found", "message": "No record with that ref." }, "citations": [] }

Codes

CodeHTTPMeaning
unauthorized401No key, or the key is wrong or revoked.
forbidden_origin403An account request came from a website that is not allowed.
invalid_request400The request body is not valid.
invalid_params400A tool's arguments failed validation. The message says which.
not_found404No such tool, record or key.
rate_limited429Over that key's allowance. Wait retry-after seconds. window is minute or day.
key_limit409You already have 5 active keys.
already_requested429You asked for higher limits in the last 24 hours.
unavailable502The government source could not be reached.
mail_failed502The email could not be sent. Nothing was counted. Try again.
kill_switch503The service is switched off.
limits_unavailable503The counters could not be read, so the service refused.
budget_exhausted503The daily budget for the whole service is used up.
internal500Something broke on our side.

Some tools return their own refusal codes. Each keeps its meaning and an HTTP status in the 4xx range, except a source that could not be fetched, which is 502.

Over MCP

Without a valid key, /mcp answers HTTP 401 with WWW-Authenticate: Bearer realm="bc-data" and a JSON-RPC error with code -32001 that says where to sign up. This applies to initialize and tools/list too.

On this page