Glossary · Protocols and standards

JSON-RPC 2.0

JSON-RPC 2.0 is a lightweight, transport-agnostic remote procedure call protocol that encodes requests, results and errors as JSON objects.

JSON-RPC 2.0 is a stateless, lightweight remote procedure call protocol in which each call and each result is a JSON object.

How it works. A request object has four members: jsonrpc, which must be exactly "2.0"; method, the name of the procedure; optional params, given as an array or an object; and id, which the client chooses. A request without an id is a notification, and the server must not reply to it. A response repeats the request’s id and contains exactly one of result or error. An error object has an integer code, a short message and optional data. The specification reserves -32700 (parse error), -32600 (invalid request), -32601 (method not found), -32602 (invalid params) and -32603 (internal error), and sets aside -32000 to -32099 for implementation-defined server errors. JSON-RPC does not depend on any transport. It works over HTTP, sockets or in-process calls.

In A2A. JSON-RPC is one of the three standard A2A protocol bindings. An agent advertises it with "protocolBinding": "JSONRPC" in its supportedInterfaces. Requests travel over HTTP(S) as application/json. In v1.0, method names are PascalCase, such as SendMessage, GetTask, CancelTask and SubscribeToTask. Version 0.3 used names like message/send and tasks/get. Service parameters such as A2A-Version and A2A-Extensions go in HTTP headers, outside the JSON body. Streaming methods answer with Server-Sent Events, and each event carries one JSON-RPC response.

A GetTask call for a task that does not exist:

{"jsonrpc": "2.0", "id": 7, "method": "GetTask", "params": {"id": "task-404"}}
{
  "jsonrpc": "2.0",
  "id": 7,
  "error": {"code": -32001, "message": "Task not found"}
}

A2A-specific errors use codes from -32001 to -32099. Examples are -32001 for TaskNotFoundError and -32009 for VersionNotSupportedError. The A2A binding also lets servers put structured details in error.data as an array of typed objects.

Neighbouring terms. MCP uses JSON-RPC 2.0 for all of its messages. In A2A, the alternatives to this binding are gRPC and HTTP+JSON/REST. An agent that offers more than one binding must give them the same operations and behaviour.

Sources

  1. JSON-RPC 2.0 Specification (accessed )
  2. A2A Protocol Specification, section 9: JSON-RPC Protocol Binding (accessed )
  3. A2A Protocol Specification, section 5.4: Error Code Mappings (accessed )