Content
## Content
1. Document Walkthrough (Blog → Github → Spec)
1. What it is
2. How to use it (video case)
3. Technical details
4. Relationship with MCP
2. Official Cases
## Resources
- [A2A Blog](https://developers.googleblog.com/en/a2a-a-new-era-of-agent-interoperability/)
- [Demo Video](https://storage.googleapis.com/gweb-developer-goog-blog-assets/original_videos/A2A_demo_v4.mp4)
- [A2A Github](https://github.com/google/A2A)
- [A2A Spec](https://google.github.io/A2A/#/)
- [Agent Card Example](https://google.github.io/A2A/#/documentation?id=agent-card-1)
- [JS Implementation](https://github.com/google/A2A/tree/main/samples/js)
- [JSON-RPC](https://www.jsonrpc.org/specification)
## Relationship between A2A and MCP
[Relationship between A2A and MCP](https://google.github.io/A2A/#/topics/a2a_and_mcp)
- MCP is responsible for connecting Agents and tools
- A2A is responsible for connecting Agent to Agent
- I guess there may still be some competition in the future

## JSON-RPC
```json
//Request
{
"jsonrpc": "2.0",
"id": 1,
"method":"tasks/send",
"params": {
"id": "de38c76d-d54c-436c-8b9f-4c2703648d64",
"message": {
"role":"user",
"data": [{
"type":"text",
"text": "tell me a joke"
}]
},
"metadata": {}
}
}
//Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"id": "de38c76d-d54c-436c-8b9f-4c2703648d64",
"sessionId": "c295ea44-7543-4f78-b524-7a38915ad6e4",
"status": {
"state": "completed",
},
"artifacts": [{
"name":"joke",
"parts": [{
"type":"text",
"text":"Why did the chicken cross the road? To get to the other side!"
}]
}],
"metadata": {}
}
}
```
## Summary
**A2A Protocol** (Agent-to-Agent Protocol) is essentially an **open standard** that defines a **consistent communication interface for interoperability between Agents**.
It specifies:
- **Interface specifications** (such as `/tasks/send`, `/tasks/sendSubscribe`, `/tasks/get`, `/tasks/cancel`)
- **Data exchange format** (based on JSON-RPC 2.0 + standardized Task/Message/Artifact structure)
- **Interaction modes** (supports synchronous calls and asynchronous streaming SSE push)
- **Discovery mechanism** (to obtain Agent capability descriptions via the standard path `/.well-known/agent.json`)
- **Authentication and error handling** (interfaces may require authentication, errors are uniformly returned in JSON-RPC error format)
| Method | Function | Parameters | Returns |
| --- | --- | --- | --- |
| `tasks/send` | Synchronously send a task | `id`, `message`, `sessionId`, `metadata` | Returns the final task status |
| `tasks/sendSubscribe` | Streamingly send a task (Server-Sent Events) | Same as above | Streamed task updates |
| `tasks/get` | Query task status | `id` | Returns the task object |
| `tasks/cancel` | Cancel a task | `id` | Returns the updated task object |
| `/.well-known/agent.json` (HTTP GET) | Discover Agent information | - | Returns Agent Card |
```mermaid
sequenceDiagram
participant ClientAgent as Client Agent
participant Server as A2A Server
participant TaskHandler as Task Processing Logic
ClientAgent->>Server: GET /.well-known/agent.json
Server-->>ClientAgent: Returns AgentCard (capability description)
ClientAgent->>Server: JSON-RPC: tasks/send or tasks/sendSubscribe
Server->>TaskHandler: Create TaskContext, call taskHandler()
alt Using tasks/send (synchronous)
TaskHandler-->>Server: Final Task object
Server-->>ClientAgent: JSON-RPC response (Task completion status)
else Using tasks/sendSubscribe (streaming)
loop During task execution
TaskHandler-->>Server: Intermediate updates (TaskStatus or Artifact)
Server-->>ClientAgent: SSE send event (status/artifact)
end
Server-->>ClientAgent: SSE final event (Task completion status)
end
ClientAgent->>Server: JSON-RPC: tasks/get
Server-->>ClientAgent: Returns current Task status
ClientAgent->>Server: JSON-RPC: tasks/cancel
Server-->>TaskHandler: Mark Task as canceled
Server-->>ClientAgent: Returns canceled Task status
```