Glossary · Protocols and standards
gRPC
gRPC is an open source RPC framework that defines services in Protocol Buffers and runs them over HTTP/2. It is one of A2A's three standard bindings.
gRPC is an open source remote procedure call framework in which services and messages are defined in Protocol Buffers and clients call generated stubs over HTTP/2.
How it works. A .proto file declares a service, its methods, and the request and response message types. Compiler plugins generate a client stub and a server interface from that file. gRPC supports four kinds of method: unary (one request, one response), server streaming, client streaming and bidirectional streaming. Message order is preserved within a single call. Each call can carry metadata, which are key-value pairs such as authentication details. Clients can set a deadline, and failures return a status code such as NOT_FOUND or FAILED_PRECONDITION.
In A2A. The normative A2A data model is written in Protocol Buffers, the format gRPC uses by default. Section 10 of the specification requires gRPC over HTTP/2 with TLS and an implementation of the A2AService service from a2a.proto (package lf.a2a.v1). The streaming operations are server-streaming RPCs that return StreamResponse messages. An abridged excerpt of the service, with HTTP annotations removed:
service A2AService {
rpc SendMessage(SendMessageRequest) returns (SendMessageResponse);
rpc SendStreamingMessage(SendMessageRequest) returns (stream StreamResponse);
rpc GetTask(GetTaskRequest) returns (Task);
rpc CancelTask(CancelTaskRequest) returns (Task);
rpc SubscribeToTask(SubscribeToTaskRequest) returns (stream StreamResponse);
}
A2A service parameters such as a2a-version and a2a-extensions travel as gRPC metadata, and gRPC lowercases the keys. A2A errors map to gRPC status codes. For example, TaskNotFoundError becomes NOT_FOUND and VersionNotSupportedError becomes FAILED_PRECONDITION. An agent advertises the binding in its Agent Card with "protocolBinding": "GRPC" in supportedInterfaces. The proto describes a gRPC address in host:port form, such as grpc.example.com:443.
Choosing a binding. An agent that offers several bindings must give each one the same operations, results, errors and authentication. The card lists interfaces in preference order, and the client uses the first one it supports.
Neighbouring terms. JSON-RPC 2.0 and HTTP+JSON/REST are the other two standard bindings. Both of them stream with Server-Sent Events instead of gRPC streams.
Sources
- gRPC: Core concepts, architecture and lifecycle (accessed )
- A2A Protocol Specification, section 10: gRPC Protocol Binding (accessed )
- A2A protocol definition (a2a.proto) (accessed )