Skip to main content
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.

Envelope shape

When a tool fails, the result it returns to the client has an error field matching the JSON-RPC 2.0 error-object shape:
The 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: Adding new codes within these ranges is non-breaking. Renumbering existing codes is a breaking change.

Common errors per tool

Handling errors in an agent

Reference

  • Tracking ticket: C-2491.
  • Implementation: backend/closient/mcp_errors.py.
  • REST counterpart: see Errors.