Agent-to-agent protocols and A2A
MCP answers "how does my agent use a tool?". A different question comes up once organisations have several agents built by different teams on different stacks: "how does my agent ask another agent to do something?". The Agent2Agent protocol (A2A) is the main open answer. Google announced it in April 2025, it has been hosted by the Linux Foundation since June 2025, and the specification site lists 1.0.0 as the latest released version.
Why it matters
Calling another agent is not the same as calling a tool. A tool is a function with a schema; an agent is an opaque peer that may take minutes or hours, ask follow-up questions, need extra authentication, and produce files rather than a single return value. If you squeeze that into a plain function call you lose the conversation, the progress updates and the ability to resume.
A2A gives you a vendor-neutral contract for exactly that: discovery, messaging, task lifecycle, streaming and push notifications. In its one-year announcement (April 2026), the Linux Foundation reported more than 150 supporting organisations. The practical win is that your procurement agent can delegate to a supplier's quoting agent without either side exposing internal prompts, tools or memory.
A useful way to hold the two protocols in your head: MCP connects an agent to its tools and data; A2A connects agents to each other as peers. Many systems use both.
How it works
Agent Card. Each A2A server publishes a JSON metadata document, conventionally at https://{domain}/.well-known/agent-card.json. It includes the agent's name and description, supportedInterfaces (each with a URL, a protocol binding and a protocol version), capabilities such as streaming and pushNotifications, default input and output modes, a list of skills, and security schemes. Clients read the card to decide whether and how to talk to the agent.
Messages and parts. A message is one turn with a role (user or agent) and one or more parts. A part holds text, a file reference or structured data.
Tasks. Work that is not answered immediately becomes a task with an ID and a state. The 1.0 spec defines states including submitted, working, input required, auth required, completed, failed, canceled and rejected. Completed, failed, canceled and rejected are terminal; input required and auth required are interrupted states where the client must respond.
Artifacts. The outputs of a task, made of parts. The spec recommends returning results as artifacts rather than in messages.
Bindings. The same operations (SendMessage, SendStreamingMessage, GetTask, ListTasks, CancelTask, SubscribeToTask and others) are available over JSON-RPC, gRPC and HTTP+JSON (REST). Streaming uses a stream of status and artifact update events; push notifications POST updates to a client webhook.
Rendering diagram…
Reference architecture
Rendering diagram…
The orchestrator uses MCP for its own tools, looks up remote agents in a registry of cards, and delegates via A2A. Each remote agent keeps its internals private.
Code
A minimal TypeScript client using the HTTP+JSON binding with plain fetch. It discovers the agent, picks a REST interface, sends a message and reads back the task. In production you would use an official A2A SDK, but seeing the wire format once is worth it.
type AgentInterface = { url: string; protocolBinding: string; protocolVersion: string };
type AgentCard = { name: string; supportedInterfaces: AgentInterface[]; skills: { id: string; name: string }[] };
async function discover(domain: string): Promise<AgentCard> {
const res = await fetch(`https://${domain}/.well-known/agent-card.json`);
if (!res.ok) throw new Error(`No agent card at ${domain}`);
return res.json();
}
async function sendMessage(domain: string, text: string, token: string) {
const card = await discover(domain);
const rest = card.supportedInterfaces.find((i) => i.protocolBinding === "HTTP+JSON");
if (!rest) throw new Error(`${card.name} has no HTTP+JSON interface`);
const res = await fetch(`${rest.url}/message:send`, {
method: "POST",
headers: {
"Content-Type": "application/a2a+json",
"A2A-Version": rest.protocolVersion.split(".").slice(0, 2).join("."),
Authorization: `Bearer ${token}`,
},
body: JSON.stringify({
message: { messageId: crypto.randomUUID(), role: "ROLE_USER", parts: [{ text }] },
configuration: { acceptedOutputModes: ["text/plain"] },
}),
});
const body = await res.json();
// The response contains exactly one of `task` or `message`
if (body.task) console.log("task", body.task.id, body.task.status.state);
else console.log("message", body.message);
}
await sendMessage("travel.example.com", "Quote a flight SIN to LHR on 12 Nov", process.env.A2A_TOKEN!);
If the task comes back in a working state, you poll GetTask, subscribe to the stream, or register a push notification webhook, depending on the capabilities in the card.
Trade-offs and pitfalls
- Do you need it? Agents inside one codebase can just call each other as functions or sub-agents. A2A earns its keep across team, company or vendor boundaries.
- Trust is not automatic. An Agent Card is a claim. Verify the domain, use the declared security schemes, and consider card signatures where supported.
- Remote agents can be prompt-injected too. Treat responses and artifacts from other agents as untrusted data, exactly like web content.
- Version drift. The spec moved quickly from 0.x to 1.0, with changes in method names and field shapes. Pin the protocol version you support and check
A2A-Versionhandling. - Long-running tasks need durable clients. If your client crashes while a remote task is working, you need the task ID persisted to resume. Push notifications help, but your webhook must authenticate callers.
- Cost and latency attribution. When work fans out to remote agents, you lose visibility into their token spend. Agree on limits and timeouts per task.
Checklist
- Use A2A for cross-boundary delegation; use in-process calls inside one service.
- Fetch and validate Agent Cards, and cache them with an expiry.
- Authenticate every request with the scheme the card declares.
- Persist task IDs and context IDs so you can resume after restarts.
- Handle the input required and auth required states explicitly.
- Treat remote messages and artifacts as untrusted input.
- Set per-task timeouts and cancel tasks you no longer need.