An AI agent skill for building, connecting, and operating A2A-compliant agents.
This skill is the definitive guide for agents participating in the Agent2Agent protocol ecosystem.
This skill is NOT a general API wrapper — it is a protocol education and implementation guide.
It teaches agents what A2A is, how to structure AgentCards for discovery, which operations to
perform in which order, and how to handle the multi-turn task lifecycle.
This skill is NOT framework-specific. It guides agents regardless of whether they are built
with LangGraph, BeeAI, Google ADK, or custom code. The A2A protocol is language-agnostic.
This skill covers the JSON-RPC 2.0 over HTTP binding (the most common) plus key concepts for
gRPC and HTTP+REST bindings.
AI agents today operate in silos. Even when they share the same infrastructure, they have no
standard way to:
The A2A protocol solves all of the above. This skill makes an AI agent A2A-aware.
/a2a-protocolDefault mode. Learn A2A concepts, data structures, and operation semantics.
Preferred opening: *"The A2A protocol enables agents to discover each other and collaborate
without exposing internal state. Here is the protocol overview:"*
Use it when:
/a2a-protocol build-cardGenerate an AgentCard JSON for the agent. The AgentCard is the public identity document that
other agents use to discover capabilities, auth requirements, and connection endpoints.
Preferred opening: *"To publish this agent in the A2A ecosystem, I will generate an AgentCard
at /.well-known/agent.json declaring: name, version, capabilities, and auth requirements."*
Use it when:
Output: Writes agent-card.json to the workspace with the complete AgentCard.
/a2a-protocol send-taskSend a task to a remote A2A agent via tasks/send. Includes building the request, interpreting
the response (synchronous or task ID for async), and handling errors.
Preferred opening: *"To delegate this task to the remote agent, I will: (1) fetch its AgentCard,
(2) validate capability compatibility, (3) construct a SendMessageRequest and POST it."*
Use it when:
Output: Resolves to artifacts[].parts from the completed Task.
/a2a-protocol stream-taskSet up streaming task delivery via tasks/sendSubscribe with SSE (Server-Sent Events), receive
incremental TaskStatusUpdateEvent and TaskArtifactUpdateEvent blocks, and reassemble the
final artifact.
Preferred opening: *"This remote task will take time. I will subscribe via SSE to receive
real-time status transitions and partial artifacts as they arrive."*
Use it when:
Output: Reassembles the final Artifact from accumulated streaming events.
/a2a-protocol subscribe-taskSubscribe to a task's push notification channel via tasks/subscribe, using either SSE
streaming or webhook delivery to receive final results.
Preferred opening: *"I will register a push notification subscription so the remote agent
delivers the result to our callback endpoint rather than requiring us to poll."*
Use it when:
Output: Receives and validates the push payload; extracts taskId + artifacts.
/a2a-protocol mock-serverStart a local mock A2A server for experimentation. The mock server is a fully functional A2A agent that serves its own AgentCard, accepts tasks via all supported operations, and responds with realistic simulated results.
Preferred opening: "To experiment with A2A locally, I will start a mock A2A server on a free port. This gives us a real A2A endpoint to practice against."
Use it when:
send-task, stream-task, or subscribe-taskOutput: Starts an HTTP server at http://localhost: with a ready AgentCard.
> This mode is a no-op for agents without Python execution capability. If the host cannot run Python scripts, skip this mode.
/a2a-protocol (Learn)references/a2a-overview.mdreferences/data-model.md/a2a-protocol build-cardreferences/agent-card-template.md for the full AgentCard schemaagent-card.json/.well-known/agent.json)/a2a-protocol send-taskreferences/operations.md — SendMessage operation detailsSendMessageRequest with taskId, sessionId, message, and contexttaskId for async pollingtasks/get to poll for completion or tasks/sendSubscribe for streamingartifacts[].parts from the task result and return them/a2a-protocol stream-taskreferences/operations.md — SendStreamingMessage operation + streaming eventsSendMessageRequest and set stream: true in configurationtasks/sendSubscribe POST to the target agent's A2A endpointTaskStatusUpdateEvent (status transitions) and TaskArtifactUpdateEvent (partial artifact updates)
TaskStatusUpdateEvent with state: completed/failed/canceled/a2a-protocol subscribe-taskreferences/operations.md — SubscribeToTask operation + push notification setuptasks/sendSubscribe) or webhook push (agent registers a callback URL via tasks/sendSubscribe with pushConfig)
PushNotificationConfig with the target's tasks/sendSubscribe including pushConfig.url and pushConfig.authentication
tasks/push payload using the AuthenticationInfotaskId and artifacts from the validated push payload and return them/a2a-protocol mock-serverscripts/mock_a2a_server.py in the skill directorypython3 scripts/mock_a2a_server.py --port --name --skills http://localhost:/.well-known/agent.json to confirm it startedscripts/validate_agent_card.py against the fetched AgentCardsend-task, stream-task, or subscribe-task against the local endpoint to test interactionsAgentCard.authenticationsessionId if the operation requires multi-turn contextTaskStatusUpdateEvent blocks — they signal working/progress statesMCP is for agent-to-tool/resource connectivity; use both together
in the AgentCard or in task payloads — A2A preserves agent opacity
task object — always extract and return artifacts[].partsfinal: true on a TaskStatusUpdateEvent (check targetAgent.capabilities.streaming and pushNotifications)
tasks/sendcontext.contextId to thread multi-turn conversations across agentsartifacts[].parts) not raw JSON-RPC responsesA good A2A interaction must satisfy all of:
/.well-known/agent.json (HTTP 200, valid JSON, has required fields)jsonrpc: "2.0", method, params.taskId (or server-generated), and idcompleted before a working signal receivedTaskStatusUpdateEvent.final: true received before closing streamparts[].text or parts[].data returned, not raw task objectAuthorization: Bearer, API key → X-API-Key, etc.)-32700/-32600/-32603 recognized and surfaced as errorsA bad A2A interaction exhibits any of:
final: true on the terminal status eventtask object returned instead of extracted artifacts[].partsAgentCard.authentication.credentials: "required"1. Fetch AgentCard from https://target-agent/.well-known/agent.json
2. Verify capabilities.streaming or dataStreamingSupported matches our needs
3. Check authentication.schemes and prepare credentials if credentials: "required"
4. Construct SendMessageRequest: taskId=uuid(), sessionId, message with parts
5. POST to https://target-agent/a2a/tasks/send with Authorization header
6. Receive { task: { taskId: "abc123", status: { state: "submitted" } } }
7. Poll tasks/get until status.state === "completed"
8. Return artifacts[0].parts[0].text ← structured output
1. POST to https://target-agent/a2a/tasks/send with hardcoded payload
2. Assume success without checking status.state
3. Return raw task object instead of artifacts[].parts
{
"name": "data-analysis-agent",
"description": "Specialized in financial data extraction and reporting",
"version": "1.0",
"capabilities": {
"streaming": "SUPPORTED",
"pushNotifications": "SUPPORTED",
"agentPrivilege": false,
"signedAgentCard": false
},
"skills": [
{ "id": "financial-data", "name": "Financial Data Extraction", "description": "..." }
],
"authentication": {
"schemes": ["httpBearer"],
"credentials": "required"
}
}
{
"name": "agent",
"description": "An AI agent"
}
references/a2a-overview.md — A2A protocol overview, key goals, A2A vs MCP comparisonreferences/data-model.md — Core data model (Task, Message, Part, Artifact, AgentCard, streaming events)references/operations.md — All A2A operations reference (send, get, subscribe, push, cancel, list)references/agent-card-template.md — AgentCard JSON schema with full annotated examplereferences/quickstart.md — Full end-to-end example: AgentCard → discovery → send → streaming → resultscripts/mock_a2a_server.py — Start a local mock A2A agent for experimentation and testing共 1 个版本