Learn · Agent access
A2A agent
Every project serves the Agent-to-Agent protocol at /a2a. Other agents can find and call the project under your access rules.
- API
POST /search- In the schema
- —
Sign-in and the agent card#
Every project answers Agent-to-Agent JSON-RPC calls at /a2a, and each branch answers at /branches/{name}/a2a. Every call authenticates via Authorization: Bearer <token> and executes under that caller’s access policies. Send A2A-Version: 1.0 as a header or query parameter.
Caller-scoped extended agent cards at /a2a
The public card at / exposes zero query names, while GetExtendedAgentCard returns only the deployed queries and actions the authenticated bearer may invoke as skills.
Anyone can read the public agent card at <label>.napalmdata.com/, which lists the endpoint address and sign-in method without exposing any query names. For an authenticated caller, GetExtendedAgentCard returns a caller-specific card listing every deployed query and action that caller may invoke as a skill, using the query’s first-line comment as the description and typed variables as the example. Queries hidden with napalm queries offer --no-agents are omitted and refused if called.
Messages#
Include a data part or a text part in message.parts. A text part carries one EdgeQL statement, and when a message contains both, only the data part executes.
curl https://<label>.napalmdata.com/a2a \ -H "Authorization: Bearer $NAPALM_KEY" \ -H "A2A-Version: 1.0" \ -H "Content-Type: application/json" \ -d { "jsonrpc": "2.0", "id": 1, "method": "SendMessage", "params": { "message": { "messageId": "8f0c2b1e-…", "role": "ROLE_USER", "parts": [{ "data": { "query": "select Note { title } filter .pinned", "variables": {} } }] } } }params
- message.
messageIdstringrequired - Unique client-generated message ID.
- message.
rolestringrequired - Must be
ROLE_USER. - message.
partsPart[]required - Each part must specify exactly one of
data,text,raworurl. Adatapart accepts six operation shapes.{ "call": "<name>", "variables": { … }, "is_dry_run"?: true }invokes a deployed query by name. An action returns the handler’s response and does not acceptis_dry_run.{ "query": "<edgeql>", "variables": { … }, "is_dry_run"?: true }runs an ad-hoc EdgeQL statement when the passthrough setting admits the caller.{ "search": { "type": "<Type>", "query": "<text>", "limit"?: 10, "fields"?: ["…"] } }runs semantic or hybrid search across an indexed object type.{ "changes": { "since" | "after": "…", "until"?: "…", "types"?: ["…"], "limit"?: 100 } }reads the change log as GET /changes does and returns the page in thedatapart.{ "ask": "<question>", "is_dry_run"?: true }answers a natural-language question when schema sharing is enabled.{ "describe": "schema" | "reach" }reads the branch’s schema or counts the caller’s reach in each type.
A branch takes 100 dry runs, tests, checks and plans a minute. A dry run past the limit fails with
rate_limited. The error’sretry_after_secondsgives the seconds to wait. - message.
contextIdstring - Optional conversation identifier echoed on the response message.
Answers and refusals#
Every call completes synchronously within one HTTP request, so SendMessage answers directly with a ROLE_AGENT message holding typed JSON rows in a data part rather than spawning background tasks to poll.
Synchronous ROLE_AGENT replies with read-your-own-writes
Peer agents send SendMessage payloads to /a2a and receive committed rows or structured AccessPolicyError diagnostics with causal read-your-own-writes consistency on every call.
{ "jsonrpc": "2.0", "id": 1, "result": { "message": { "messageId": "c3a91d07-…", "contextId": "5b7e2f90-…", "role": "ROLE_AGENT", "parts": [{ "data": { "data": [{ "title": "Launch checklist" }] }, "mediaType": "application/json" }] } }}When an access rule refuses a write or a statement fails to compile, the response carries the diagnostic in both a human-readable text part and a structured data part.
"parts": [ { "text": "query_failed (AccessPolicyError): An access rule refused it. This caller may not make that change." }, { "data": { "error": { "code": "query_failed", "type": "AccessPolicyError" } }, "mediaType": "application/json" }]The schema and your reach#
{ "describe": "schema" } returns the branch’s schema, and { "describe": "reach" } counts the rows the caller can read, update and delete per type alongside readable file bytes. Both calls require schema sharing and an admitted passthrough caller, matching MCP’s describe_reach.
Methods#
| Method | Behavior |
|---|---|
SendMessage | Runs the message’s call, statement, search, change log read, question or description. Answers with a ROLE_AGENT message. |
GetExtendedAgentCard | Answers the card with every deployed query and action the caller may invoke. |
ListTasks | Answers no tasks ({ "tasks": [] }) because every call finishes within the request. |
GetTask, CancelTask | Error -32001. No such task exists. |
SendStreamingMessage, SubscribeToTask | Error -32004. Use SendMessage. |
Push notification methods | Error -32003. Push notifications are not supported. |
Error codes#
Transport-level refusals return HTTP statuses before JSON-RPC parsing, including 401 when the credential is missing or revoked, 404 while the project’s API is disabled and 413 for a body over 1 MiB. A JSON-RPC notification (a request with no id) returns 202 Accepted. Every other refusal returns an A2A or JSON-RPC code.
| Code | Condition |
|---|---|
-32001 | GetTask or CancelTask called (no async tasks exist) |
-32003 | Push notification method called |
-32004 | Streaming method called |
-32007 | GetExtendedAgentCard when no extended card exists for the caller |
-32009 | Missing or unsupported A2A-Version (expected 1.0) |
-32602 | Invalid method parameters or a Part containing multiple content keys |
-32601 | Unknown JSON-RPC method |
-32700 | Malformed JSON body |
-32600 | Invalid JSON-RPC 2.0 envelope or batch array |
Multi-agent pipelines walks through one project’s agent calling another project’s agent.