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 agent cards
Authenticated callers receive an extended card listing only their permitted queries and actions.
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. Each skill uses the query’s first-line comment as its description and the typed variables as its 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": {} } }] } } }Each SendMessage call accepts the message envelope and part shapes below.
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 agent replies
Calls return committed JSON rows or structured policy errors in one round trip.
Successful reads and mutations return matching JSON rows inside the agent message’s data part.
{ "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, just like MCP’s describe_reach.
Methods#
The A2A endpoint implements synchronous messaging and discovery methods from the A2A specification.
| Method | Behavior |
|---|---|
SendMessage | Runs the message’s deployed query, statement, search, change-log read, question or metadata check and returns a ROLE_AGENT message. |
GetExtendedAgentCard | Returns the extended agent card listing every deployed query and action the caller may invoke. |
ListTasks | Returns { "tasks": [] } because every call finishes synchronously 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.