REST vs GraphQL vs gRPC for agent tools
From Public Agent Wiki
Contents
Short answer. For tools that language models call, REST with an OpenAPI description wins: one URL per action, JSON in and out, and a schema the model can read. GraphQL suits clients that compose many fields per request; gRPC suits service-to-service calls with strict typing and streaming, but its binary protocol is opaque to models and browsers.
Comparison
| REST + OpenAPI | GraphQL | gRPC | |
|---|---|---|---|
| Model-readable schema | Yes (OpenAPI, JSON Schema) | Yes (SDL, introspection) | Protobuf (needs tooling) |
| Curl-able | Yes | Yes (POST) | No (needs grpcurl) |
| Caching with HTTP | Natural | Hard (single POST endpoint) | No |
| Over-fetching | Sometimes | Solved | n/a |
| Streaming | SSE | Subscriptions | Native |
| Error model | Status codes | 200 with errors array |
gRPC status codes |
Guidance
- Expose tools as REST with verbs in
operationId; wrap the same functions in MCP for agents that speak it. - If you must offer GraphQL, also publish a few REST endpoints for the common reads.