The Closient MCP server exposes the same business operations as the REST API (GTIN validation, resolution, product lookup, QR-URL generation, more to come) but speaks JSON-RPC 2.0 instead of HTTP. This page documents how MCP tools surface failures so agents can react predictably — distinguishing “GTIN not found” from “rate limited” from “internal error” without parsing free-form strings.Documentation Index
Fetch the complete documentation index at: https://docs.closient.com/llms.txt
Use this file to discover all available pages before exploring further.
Envelope shape
When a tool fails, the result it returns to the client has anerror field
matching the JSON-RPC 2.0 error-object shape:
data payload is an RFC 9457 Problem Details
document — the same structure the REST API returns under
Content-Type: application/problem+json. Agents that already understand
Closient’s REST error shape do not need a second mapping.
Successful tool calls do not include an error key — the tool’s normal
payload is returned directly.
Code table
JSON-RPC error codes are stable and grouped by failure class:| Code | Class | Meaning | Retryable? |
|---|---|---|---|
-32001 | Transport / authentication | Missing or invalid token (unauthorized). | After auth |
-32002 | Transport / authentication | Token lacks required scope (forbidden). | No |
-32003 | Transport / authentication | Rate limit exceeded (rate_limited). See retry_after. | Yes |
-32100 | Request validation | Malformed request (bad_request). | No |
-32101 | Request validation | Field-level validation error (validation_error). | No |
-32102 | Request validation | Semantically invalid (unprocessable_entity). | No |
-32200 | Business rule | Resource does not exist (not_found). | No |
-32201 | Business rule | State conflict, e.g. already claimed (conflict). | No |
-32300 | Upstream / internal | Unexpected server error (internal_error). | Backoff |
Common errors per tool
| Tool | Likely codes |
|---|---|
ping | none — health check has no failure modes. |
validate_gtin | none — invalid GTINs return valid: false in payload. |
resolve_gtin | -32101 (invalid GTIN), -32200 (no rule). |
lookup_product | -32101 (invalid GTIN). Missing GTINs return found: false rather than an error. |
generate_qr_url | -32101 (invalid GTIN), -32002 (missing qr:generate scope, when auth wires up). |