Skip to main content

MCP Errors and Audit

Errors​

A tool that fails returns a normal tool result with isError: true. Its text is a JSON object:

{"error": {"status": 403, "code": "PERSONAL_ACCESS_TOKEN_SCOPE_DENIED", "detail": "personal access token is not permitted to perform this operation"}}

A failed tool call is not an HTTP error: the HTTP response is still 200. Only a refused connection (a missing or invalid token, or a browser session) is an HTTP 401.

For a failure inside the REST operation, status, code and detail are the operation's own Problem Details. Validation errors from the operation are appended to detail with the field they apply to. Common ones:

CodeMeaning
PERSONAL_ACCESS_TOKEN_SCOPE_DENIEDThe token doesn't have the scope the tool needs.
PERSONAL_ACCESS_TOKEN_WORKSPACE_DENIEDThe token is restricted to a different workspace than workspace_id.

The MCP layer adds these codes:

CodeMeaning
workspace_requiredNo workspace_id, and the token isn't restricted to a workspace.
workspace_not_foundThe workspace doesn't exist, or you aren't a member.
plan_feature_requiredThe workspace's plan doesn't include AI assistant connections, or, for a bills tool, bills.
invalid_argumentsAn argument is missing, has the wrong type, or isn't offered.
idempotency_key_requiredA write tool was called without a valid idempotency_key.
idempotency_key_reusedThe key was already used for a different change.
confirmation_invalidThe confirmation token is invalid, expired or for other arguments.
rate_limitedAn MCP budget is exhausted. See Limits.
result_too_largeThe result is over 256 KB. Narrow the date range or filters, or use a smaller pageSize.

See Idempotency and Confirmations for the idempotency and confirmation codes.

Audit​

Every change made through a write tool records the audit event mcp.tool_called in the same transaction as the change, so a change is never saved without its record. The event stores the tool, the REST operation, what was changed, the token ID, the client's User-Agent (up to 100 characters) and a correlation ID. It never stores memos, amounts or other arguments.

Application events and webhooks published by the change carry the same correlation ID, so you can trace them back to the tool call.

A write that fails leaves no audit record. Read tools aren't audited.