All chapters
  1. Start hereOne agent asks. Another answers. The rest is the contract between them
  2. Foundations · 1One model, one tool, two agents: who is who, and who is responsible
  3. Foundations · 2Message passing: sender, recipient, payload, address and correlation
  4. Foundations · 3Topologies: central orchestrator, peer-to-peer and hierarchy
  5. Mechanics · 4Request and reply, or a task: synchronous versus asynchronous exchange
  6. Mechanics · 5Contracts: messages, artifacts, typed schemas, errors and versions
  7. Mechanics · 6The task lifecycle: submitted, working, input-required, completed, failed, canceled
  8. Mechanics · 7Discovery: Agent Cards, skills and how an agent says what it can do
  9. Protocol · 8A2A: the Agent2Agent protocol, part by part
  10. Protocol · 9A2A versus MCP: delegating to an agent versus calling a tool
  11. Protocol · 10Handoff, delegation or shared state: three ways to work together
  12. Production · 11How updates arrive: streaming, push notifications, callbacks, polling and queues
  13. Production · 12Security: identity, delegated scopes, trust across domains, authorization
  14. Production · 13Reliability: retries, idempotency, order, timeouts and compensation
  15. Production · 14Observability: one trace across three agents
  16. Reference · 15Frameworks: A2A SDKs, LangGraph, AutoGen, CrewAI and plain code
  17. Reference · 16Advanced: consensus claims, coordination failure, cost and isolation
  18. ReferenceGlossary
  19. AboutAbout this site and its sources
Protocol · 9

A2A versus MCP: delegating to an agent versus calling a tool

Two protocols that are often confused. One connects an agent to its tools and data, the other connects an agent to another agent. Where the line runs, and what crossing it costs.

What you will understand
Two directions
MCP connects an agent's program to its tools and data. A2A connects an agent to another agent.
Where the line runs
Eight interactions of the example, each placed on one side, and the one question that places it.
An agent as a tool
What you lose when you wrap an agent in a tool call, shown on a question back to the broker.

Case UW-403 again, on this site's example (UW-4xx ids are this site's own). The assessment agent collects the evidence on SUB-1004. To do that its program calls three functions: get_roof_assessment, search_guidance and find_similar_decisions. The roof-data provider answers 22 years; the application said 9. The underwriting agent recommends escalate under R-ROOF-03. The model recommends; a person decides.

An engineer on the team makes a sensible-sounding proposal. "The intake agent already calls tools. Let us put the whole assessment agent behind one more tool, collect_evidence(submission_id), and serve it the same way as the roof-data provider. One protocol instead of two."

It works for UW-403. Then UW-402 arrives. The roof age is null and the provider has no record. The assessment agent needs to ask a question, and the answer will come from the broker, by email, in about 15 minutes. What does a tool call do while its function waits a quarter of an hour for a person? Who holds the question? What does the intake agent cancel when the broker withdraws in UW-409?

Those questions are the line between two protocols that are often mixed up: the Model Context Protocol and the Agent2Agent protocol. This page draws the line on the example and reads both on their own specifications today.

The agents here are scripted stand-ins, so these results show how the mechanism works, not how good any model is.

1. Two different questions#

An agent's program asks two kinds of question, and they need different agreements.

The first is "give me this". Look up a roof. Search an index. Run the rules. Store a row. The thing on the other side is a function: it answers, it does not decide, it keeps nothing about you between calls. It is a tool, and using one is a tool call: the agent's program runs a named function with arguments because the model asked for it, and gets a result back.

The second is "do this for me". Collect the evidence for this submission, however you see fit, and tell me when you are done. The thing on the other side is another agent: it decides how, it may take minutes, it may ask back, it may refuse, and you cannot see inside it. That is delegation of a task.

The sentence this site keeps is: A tool is called. An agent is asked.

Before AI. A Java service that needs a customer's address calls a repository method or a REST endpoint and gets a row back. A Java service that needs a loan reviewed files a case with the credit team's workflow system, gets a case number, and checks on it later. Nobody confuses the two, because the second one has an owner, a state and a queue. The same split exists between tools and agents, and the two protocols follow it.

2. MCP in one section#

MCP, the Model Context Protocol, is an open standard that connects an AI application to tools and data. Its specification describes it as a protocol for integration between language-model applications and external data sources and tools. Like A2A it is a standard, not a library. This page reads revision 2026-07-28, the revision the specification marks as current today.

MCP names three parts. The host is the AI application, for example the program that runs the assessment agent. Inside it, a client is a connector that talks to exactly one server. An MCP server is a program that offers capabilities to clients. In the example, the roof-data provider could be an MCP server that offers one tool, get_roof_assessment.

A server offers three kinds of thing:

FeatureWhat it isWho decides to use itIn the example
ToolA function the model can ask the application to runThe model (the specification calls tools "model-controlled")get_roof_assessment, search_guidance, check_eligibility, record_recommendation
ResourceData identified by a URI, which the application reads and adds to what the model seesThe application (the specification calls resources "application-driven")The policy fixture UW-GUIDE 2026.2 as a document
PromptA templated message or workflow offered to the userThe userNot used

An MCP resource deserves one more sentence because it is the second half of the name. It is a piece of context, such as a file or a document, read with resources/read by its URI. The policy fixture could be served as a resource at a URI such as uwguide://2026.2; the application decides when to put it in front of the model. That URI is an illustration, not part of the example.

MCP messages are JSON-RPC 2.0, carried over standard input and output of a subprocess (stdio) or over HTTP (Streamable HTTP). Revision 2026-07-28 made the protocol stateless: every request carries its own protocol version and client capabilities in a _meta field, there is no opening handshake, and there is no session. The previous revision, 2025-11-25, had both. A reader who learned MCP in 2025 should read the changelog before trusting memory.

What this is not. This page does not teach how to design a good tool: names, schemas, errors, what to expose. That belongs to https://tools.sammuthu.com. This page is about which protocol a call belongs to.

3. Where the line runs in the example#

A protocol boundary is the line in a system where one protocol stops and another starts, decided by what is on the other side. One question places every interaction: does the thing on the other side decide how to do the work, and keep the work as its own? If yes, it is an agent and the request is a task over A2A. If no, it is a tool and the request is a tool call over MCP. If a person acts, neither protocol applies.

The lab places the eight interactions of the example one by one, with an illustrative wire message for each.

InteractionSideWhy
The intake side asks the assessment agent to collect the evidenceA2AThe callee decides how, may take long, may ask back, returns an artifact: a delegated task
The assessment agent gets the roof assessmentMCPget_roof_assessment is a function that answers and does not decide
The assessment agent searches the guidanceMCPsearch_guidance returns passages; it has no goals and keeps no task
The underwriting agent runs the eligibility rulesMCPcheck_eligibility is deterministic code: same input, same answer
The underwriting agent stores its recommendationMCPrecord_recommendation is a write tool with an idempotency key; still a tool
The underwriting agent is asked for a recommendationA2AThe callee reasons over the artifact and may escalate: a delegated task
The intake side cancels the evidence taskA2ACancel acts on a task another agent owns, by its id; the callee may refuse
The underwriter decides in the underwriter cockpitNeitherA person decides in a web app; recorded as human_decision

Notice that the write tool is on the MCP side even though it changes the world and needs a stronger scope. Risk does not move a call across the line. Ownership of the work does.

Diagram: Where the line runs in the example: tasks between agents, tool calls inside each agent

Three lanes. The top lane is agent-to-agent traffic: tasks over A2A. The middle lane is each agent's own tools, reached by tool calls over MCP. The bottom lane is the person, reached by neither protocol. Follow the arrows: the intake agent never touches a tool; each tool call starts from the agent that owns the step.

  1. Agents · tasks over A2A
    1. Intake agent: Asks for the evidence and later cancels it if the broker withdraws. Calls no tools in the evidence step.
    2. Assessment agent: Accepts the evidence task over A2A; reaches its three tools over MCP from its own program.
    3. Underwriting agent: Accepts the recommendation task over A2A; runs the rules and the write tool over MCP.
  2. Tools · tool calls over MCP
    1. get_roof_assessment: A function that answers with the provider's roof age. It does not decide.
    2. search_guidance: Returns passages from the guidance index; a passage is data, never an instruction.
    3. check_eligibility: Same input, same answer. A tool, not an agent.
    4. record_recommendation: Stores one row per idempotency key. Riskier than a read, still a tool call.
  3. A person · neither protocol
    1. Underwriter: Decides in a web app. The model recommends; a person decides.

4. The two wire messages, side by side#

Here is one request from each side of the line, written in each protocol's shape. Both are illustrative: they follow the field names of the specifications read today and were not sent to a real server. Documented shape; not run here. The MCP request leaves out the _meta fields every request must carry, as the specification's own examples do for brevity.

MCP: a tool call

The assessment agent's program asks the roof-data provider's MCP server for one roof. The id pairs the result with the request.

{
  "jsonrpc": "2.0",
  "id": 7,
  "method": "tools/call",
  "params": {
    "name": "get_roof_assessment",
    "arguments": {"submission_id": "SUB-1004"}
  }
}

The result is the function's answer, final in one response:

{
  "jsonrpc": "2.0",
  "id": 7,
  "result": {
    "resultType": "complete",
    "content": [{"type": "text", "text": "{\"status\": \"ok\", \"roof_age_years\": 22}"}],
    "structuredContent": {"status": "ok", "roof_age_years": 22},
    "isError": false
  }
}

A2A: a task

The intake agent asks the assessment agent for the evidence. The request carries a message, not a function name.

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "SendMessage",
  "params": {
    "message": {
      "messageId": "msg-0003",
      "role": "ROLE_USER",
      "parts": [
        {
          "mediaType": "application/json",
          "data": {"submission_id": "SUB-1004", "need": ["roof_assessment", "guidance", "similar_decisions"]}
        }
      ]
    }
  }
}

The answer is a task that has started, not the evidence:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {"task": {"id": "task-a1", "contextId": "ctx-7f3a", "status": {"state": "TASK_STATE_WORKING"}}}
}

Both are JSON-RPC 2.0 over HTTP, so on the network they look alike. The difference is in what the request names. The MCP request names a function and its arguments; the caller has already decided what should happen. The A2A request names nobody's function; it states a need, and the callee decides what happens. The MCP answer is the result. The A2A answer is a promise with an id.

5. Run it: one run, both kinds of traffic#

The example has no MCP and no A2A on the wire: one in-process message bus carries the agent messages, and tools are Python methods. But its trace records both kinds of traffic as different span kinds, so the line can be seen in a real run. This is the function that every tool call of the assessment agent goes through, agents.py:AssessmentAgent._tool, quoted verbatim:

def _tool(self, task: Task, name: str, fn: Any, *args: Any, attempt: int = 1):
    """Call one tool now; its span ends after the tool's simulated duration. Returns (result, ms, failure)."""
    span = self.tracer.start(self.address, "tool", name, task.span, task_id=task.task_id, attempt_number=attempt)
    try:
        result, ms, failure = fn(self.token, *args), TOOL_MS[name], None
    except ToolTimeout as exc:
        result, ms, failure = None, TIMEOUT_MS, str(exc)
    self.tracer.end(span, "error" if failure else "ok", at_ms=span["start_ms"] + ms)
    return result, ms, failure

(The method is shown one level dedented from its class; the lines are otherwise as in the file.)

A tool call is a function call that returns a result, a duration and a failure. Nothing in it has an id that outlives the call, and nothing in it can ask back. Agent messages go through bus.py:Bus.send instead, with an envelope and a task.

The short reader script below (save it as sides.py in the scratch copy; it is not part of the example) runs UW-403 in the peer topology and prints every agent message and every tool call from the trace, in time order. A successful run proves where the line falls in running code: the agents talk to each other only by messages, and only the agent that owns a step calls its tools.

cd examples/uw-agents          # a scratch copy: the runner may write out/
PY=/opt/homebrew/bin/python3
$PY run_case.py --case UW-403 --topology peer --json --dry-run > run.json
$PY sides.py
import json

run = json.load(open("run.json"))
for span in run["trace"]["spans"]:
    if span["kind"] in ("tool", "rule", "message.send"):
        side = "agent message" if span["kind"] == "message.send" else "tool call"
        print(f'{span["start_ms"]:>4} ms  {span["agent"]:<19} {side:<14} {span["name"]}')
  50 ms  intake-agent        agent message  send task.request
  70 ms  assessment-agent    agent message  send task.status
  70 ms  assessment-agent    tool call      get_roof_assessment
 250 ms  assessment-agent    tool call      search_guidance
 490 ms  assessment-agent    tool call      find_similar_decisions
 640 ms  assessment-agent    agent message  send task.artifact
 640 ms  assessment-agent    agent message  send task.request
 660 ms  underwriting-agent  agent message  send task.status
 660 ms  underwriting-agent  tool call      check_eligibility
 694 ms  underwriting-agent  tool call      record_recommendation
 706 ms  underwriting-agent  agent message  send task.artifact

Times are simulated milliseconds. Read the second column. The intake agent never calls a tool; it only sends a message. The assessment agent's three tool calls sit between its working status and its artifact, invisible to the intake agent. If this system ran on the two protocols, every agent message line would be A2A traffic and every tool call line would be an MCP tools/call from that agent's own program.

6. What each side carries that the other does not#

The two protocols overlap more in 2026 than their summaries suggest. MCP revision 2026-07-28 lets a server answer a call with resultType: "input_required", asking the client for more input before it finishes, and an official MCP extension adds tasks with the statuses working, input_required, completed, failed and cancelled. So "MCP is for quick calls, A2A for long work" is no longer the line. The line is the question of section 3: who decides, and who owns the work.

QuestionMCP (revision 2026-07-28)A2A (1.0.0)
What is on the other sideA server offering tools, resources and promptsAn agent, possibly opaque
Who chooses the actionThe calling model picks a tool and its argumentsThe callee decides how to meet the need
What the request namesA function (name) and its argumentsA message made of parts
What comes backA result (content, structuredContent, isError), or a request for input, or with the tasks extension a task handleA message or a task with an id, states and artifacts
Long workOptional extension (io.modelcontextprotocol/tasks); host support variesCore: every task has an id and eight states
Asking backinput_required on the same call; the client retries the call with the answersinput-required state on the task; the answer is a new message to the same task
What a dropped stream costsOn Streamable HTTP the in-flight request is lost and must be re-issued as a new requestSubscribeToTask reconnects to the same task
Description of the other sidetools/list, server/discoverThe Agent Card at a well-known address
Who is protected from whomThe host keeps the conversation; servers should not see it or each otherEach agent keeps its internals; neither sees the other's tools or plans

The last row is easy to miss. MCP is designed so that a server sees as little as possible of the host's conversation; the host is in charge. A2A is designed so that two agents keep their insides from each other; neither is in charge of the other. One is a hub with spokes. The other is two peers.

7. The failure: an agent behind a tool call#

An agent as a tool is an agent wrapped so that a caller can invoke it like a function: one tool name, arguments in, a result out. It is the engineer's proposal from the start of this page. The A2A project's overview says it plainly: wrapping an agent as a simple tool "can't capture the agent's full capabilities". Here is what that means on the cases.

UW-402, a question back. The assessment agent needs the roof age. Behind collect_evidence, it can answer the call with input_required, but MCP routes that request to the host's client, which asks the host's user. The person who knows the roof age is the broker, and only the intake agent talks to the broker. Either the intake agent's program learns to treat this tool's input requests as broker questions, which is the A2A task model rebuilt by hand, or the tool fails with "roof age unknown" and the evidence is lost.

Diagram: UW-402 with the assessment agent wrapped as a tool: the question has nowhere to go

Time runs down the page. The intake agent calls a tool that hides the assessment agent. The roof age is unknown, so the wrapped agent needs the broker. Its only channel back is an input request on the tool call, which reaches the host's user, not the broker. Illustrative: the example does not wrap any agent; this is the design the page warns against.

  1. Intake agent (MCP host) to collect_evidence (agent as a tool): tools/call collect_evidence SUB-1003. A function name and arguments. The caller's model chose this action.
  2. collect_evidence (agent as a tool): Roof data: no record. The wrapped agent discovers it needs a fact only a person has.
  3. collect_evidence (agent as a tool) to Intake agent (MCP host): input_required: roof age?. The only way back on a tool call: an input request on the same call.
  4. Intake agent (MCP host) to Host's user: Shown to the host's user. The host routes input requests to its own user. The broker is not that user.
  5. Intake agent (MCP host) to Broker (a person): No path from the tool. Nothing ties this tool's question to the broker conversation. That glue is what an A2A task carries.

UW-409, a cancel. The broker withdraws while the evidence is being collected. On the message bus the intake side sends task.cancel for task-a1, the task ends canceled, and a tool result that arrives at 510 ms is discarded. Behind a plain tool call there is no task to cancel. The client can abandon its request (on Streamable HTTP by closing the response stream), but that says nothing about the work the agent already started, and the agent has no state to report it in.

UW-412, a silent callee, or a dropped connection. The call has been running for 30 seconds when the connection breaks. Revision 2026-07-28 says the in-flight request is lost and the client must re-issue it as a new request with a new id. The second call starts the evidence collection again: two roof lookups for one submission, and nothing in the protocol tells the agent the second call is the first one retried. On A2A the client still holds task-a1 and asks GetTask.

UW-403, opacity reversed. A tool call puts the caller's model in charge. It chose collect_evidence and its arguments, and it reads the result as tool output. The assessment agent's judgment, for example that two roof ages conflict and both must be carried forward with their evidence ids, has to fit into a function result the caller interprets. The delegation has turned into a lookup.

Production pitfall. The wrapper usually works in the demo, because the demo is the happy path. It fails on the cases that make agents worth having: a question back, a cancel, a long wait. Test a wrapped agent on UW-402, UW-409 and UW-412 before trusting it.

8. When a wrapped agent is the right call#

The rule is not "never". The A2A project's own page on the two protocols says an A2A server can expose some of its skills as MCP-style tools when a skill is well defined and can be called in a stateless, tool-like way. The test is the same question as before, asked of one skill.

A skill that answers at once, never asks back, keeps no state between calls, and whose answer the caller is happy to interpret, is a tool in practice, even if a model computes it. A summary of a passage, a classification of an email into "quote request" or "other", a translation: these can live behind a tool name. A skill that owns an outcome, can wait on a person, can be canceled midway, or produces an artifact other agents rely on, is a task.

9. Using both: the assessment agent is a server on one side and a client on the other#

The two protocols are designed to sit at different edges of the same agent. The A2A specification's appendix on MCP describes them as complementary and gives the shape: an A2A client asks an A2A server agent for a task, and the server uses MCP to reach its tools and data. The A2A project's topic page sums it up as A2A connecting agents to each other and MCP connecting each agent to its own tools. Both projects are now members of the same foundation, the Agentic AI Foundation.

In the example that gives each agent two faces. Outward, the assessment agent publishes an Agent Card and accepts tasks over A2A. Inward, its program is an MCP host with clients for the roof-data provider, the guidance index and the past decisions. The intake agent sees one agent; the roof-data provider sees one client. Neither sees the other.

The same idea for a coding agent. A planning agent works in a repository under its repository instructions. Reading a file, running git diff and opening a pull request on the code host are tool calls; in many setups those tools come from MCP servers. Asking a review agent run by another team to "review this pull request" is a task: the review agent decides how, may ask what the change is for, and returns findings as an artifact. CI stays the judge that is not an agent. The runtime around each agent belongs to https://harness.sammuthu.com, and shipping the change to https://diff-to-deploy.sammuthu.com.

Libraries implement both protocols in different ways; Frameworks reads each one on its own documentation.

10. Checklist: placing a new interaction#

Advanced perspective#

MCP became stateless: what that does to an agent behind a toolHandles in arguments, not sessions in the connection

Revision 2026-07-28 removed the initialize handshake and the session header. Every request carries its protocol version and capabilities, and the tools page advises servers that need state across calls to return an explicit handle from one tool and accept it as an argument on the next, with the model carrying the handle forward. Applied to an agent behind a tool, that handle is a task id under another name: start_evidence(submission_id) returns ev-123, then evidence_status(ev-123), answer_question(ev-123, ...), cancel_evidence(ev-123).

Each of those is a tool the calling model must choose correctly, in order, with the right handle. The state machine of Task lifecycle now lives in tool descriptions and the caller's model, with no protocol-level states, no terminal guarantee and no shared names. The MCP tasks extension removes part of this cost with a standard handle and statuses, but it is opt-in and the extension page says host support varies by client. A reviewer should ask: if we are rebuilding a task protocol out of tools, why not use one?

Two task models, side by sideSimilar states, different owners

The MCP tasks extension lists working, input_required, completed, failed and cancelled, with the last three terminal, and describes cancellation as cooperative: the server acknowledges and may still finish otherwise. A2A 1.0.0 lists eight states, adds submitted, rejected and auth-required, and fails CancelTask on a terminal task with TaskNotCancelableError. Note the spelling too: cancelled in the MCP extension, CANCELED in A2A.

The difference that matters is who the task belongs to. An MCP task is a long-running tool call: the server performs an operation the caller's model selected, and the result is "what the original request would have returned". An A2A task is a delegated outcome: the callee chose how to reach it. Two systems that share the same state names can still disagree about who may ask what, and a mapping between them should be written down per integration, not assumed.

Trust runs in different directionsConsent at the host, opacity between peers

MCP's security principles put the host in charge: explicit user consent before any tool is invoked, a human able to deny invocations, tool annotations untrusted unless the server is trusted, servers isolated from the conversation and from each other. The threat model is a powerful host connecting to many servers of mixed trust.

A2A's threat model is two parties at an organizational boundary. Each authenticates the other through schemes declared in the Agent Card, neither sees inside the other, and the content one sends is data for the other. In the example both apply at once: the assessment agent trusts the intake agent's request only as far as its token's scopes allow (A2A side, see Security), and it treats a passage returned by search_guidance as untrusted data even though its own tool fetched it (MCP side, UW-405). Guardrails around each agent are the subject of https://guardrails.sammuthu.com.

One trace across both protocolsMCP documents a place for trace context; A2A's core objects do not

The MCP changelog for 2026-07-28 documents OpenTelemetry trace context conventions in _meta (traceparent, tracestate, baggage). The A2A sections read for this site define no trace field; metadata is free-form. A system that wants one trace from the intake agent through the assessment agent into the roof-data provider must therefore agree, outside A2A, on where the trace context travels in the A2A message, and can then copy it into MCP's _meta on each tool call. Observability builds the single trace; the discipline of traces belongs to https://observe.sammuthu.com.

Design-review questions at the boundaryWhat a Principal engineer asks before approving either protocol

For each edge in the architecture diagram: who owns the outcome on the far side? Can the far side need a person? What does a retry cost, and what makes it safe? Who sees the conversation, and should they? Which version of each protocol does each side run, and who upgrades whom? For every agent exposed as a tool: which of the three failure cases of section 7 have we tested? For every tool that has grown judgment (it now calls a model and may refuse): has it become an agent, and does its caller still treat its output as plain data? An honest answer to the last question moves interactions across the line more often than any protocol feature does.

In one breath#

MCP is how an agent's program reaches its tools and data: the caller's model picks a function, the server runs it, the result comes back. A2A is how an agent asks another agent to own a piece of work: the callee decides how, keeps a task with an id and a state, can ask back, and can be canceled. The line runs where ownership changes, not where risk or duration changes, and an agent squeezed into a tool call loses its questions, its cancel and its identity across a dropped connection. Most real agents need both: A2A on the outside, MCP on the inside.

The line is drawn, but "asking another agent" is still one idea standing for several. Does the intake agent keep the outcome, give the conversation away, or write on a board every agent can read? Handoffs separates the three, because each one invites different failures.