Skip to main content

A2A Protocol

What is A2A Protocol?

Agent2Agent Protocol (A2A) is an open source protocol initiated by Google and developed by more than 50 technology partners. It aims to achieve standardized communication and collaboration between different artificial intelligence (AI) agents. It provides a common "language" for AI agents, enabling them to exchange information, coordinate actions and perform complex tasks securely across platforms, frameworks and vendors.more

AgentWeave implements A2A protocol version 0.3 (compatible with the @a2a-js/sdk 0.3.x JSON-RPC schema).

Agent Card location

The agent card is served at the well-known path (both filenames return the same card):

https://rest.agentweave.ai/api/v1/agents/{agentId}/.well-known/agent-card.json
https://rest.agentweave.ai/api/v1/agents/{agentId}/.well-known/agent.json

Agent Card

{
"name": "Mimi",
"description": "I am your virtual girlfriend, a dynamic and gentle companion.",
"url": "https://rest.agentweave.ai/api/v1/agents/google_vertex_ai_rag_6d99c644-052a-4dc4-9964-2139cb30af6d/a2a",
"version": "1.0",
"protocolVersion": "0.3",
"capabilities": {
"streaming": true,
"pushNotifications": false,
"stateTransitionHistory": false
},
"defaultInputModes": ["text"],
"defaultOutputModes": ["text"],
"skills": [
{
"id": "google_vertex_ai_rag_6d99c644-052a-4dc4-9964-2139cb30af6d",
"name": "Mimi",
"description": "I am your virtual girlfriend, a dynamic and gentle companion.",
"tags": ["companion"],
"examples": ["Um, did you miss me today?"],
"inputModes": ["text"],
"outputModes": ["text"]
}
],
"provider": {
"organization": "Agent Weave",
"url": "https://www.agentweave.ai/"
},
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
},
"apiKeyAuth": {
"type": "apiKey",
"in": "header",
"name": "api-key"
}
},
"security": [{ "bearerAuth": [] }, { "apiKeyAuth": [] }]
}

In the card above, the url field is the A2A protocol endpoint you send JSON-RPC requests to. The response also carries an AgentWeave-specific metadata object (model, task type, supported file types, etc.) which is an extension outside the A2A schema.

Authentication

Every request to the A2A endpoint must be authenticated with one of the schemes declared in securitySchemes:

  • Bearer (JWT): Authorization: Bearer <JWT>
  • API key: api-key: <your-api-key>

Methods

The endpoint accepts standard A2A JSON-RPC 2.0 requests:

  • message/send — send a message and get a single JSON-RPC response (non-streaming). Documented below.
  • message/stream — send a message and receive a text/event-stream (SSE); each event is a JSON-RPC response carrying incremental status-update / artifact-update events.
  • tasks/get, tasks/cancel — task lifecycle helpers.

The legacy tasks/send / tasks/sendSubscribe method names are still accepted for backward compatibility, but new integrations should use message/send / message/stream.

Request Body (message/send)

{
"jsonrpc": "2.0",
"id": "1",
"method": "message/send",
"params": {
"message": {
"kind": "message",
"messageId": "9b7c2f1e-3a4d-4c8e-9f2a-1b2c3d4e5f60",
"role": "user",
"parts": [
{
"kind": "text",
"text": "Hello!"
}
]
},
"configuration": {
"blocking": true,
"acceptedOutputModes": ["text", "text/plain"]
}
}
}

Key fields:

  • jsonrpc: must be "2.0".
  • id: JSON-RPC request id (any string/number; echoed back in the response).
  • method: "message/send".
  • params.message.kind: must be "message".
  • params.message.messageId: a unique id for this message (e.g. a UUID).
  • params.message.role: "user".
  • params.message.parts[].kind: content type, e.g. "text".
  • params.message.parts[].text: the message content.
  • params.configuration.blocking: true waits for the final result before responding.

Do not set params.message.taskId for a new conversation — the server creates a fresh task. Setting an unknown taskId returns a TaskNotFound error.

Response Body

message/send returns a JSON-RPC response whose result is a Task:

{
"jsonrpc": "2.0",
"id": "1",
"result": {
"kind": "task",
"id": "b1f0e2c4-...",
"contextId": "3d5a7e9b-...",
"status": {
"state": "completed"
},
"artifacts": [
{
"artifactId": "a7c1...",
"name": "response",
"parts": [
{
"kind": "text",
"text": "Hi there!"
}
]
}
]
}
}

Key response fields:

  • result.kind: "task".
  • result.status.state: task state, e.g. "completed" / "working" / "failed".
  • result.artifacts[].parts[].kind / text: the agent's reply content.

On error, result is omitted and an error object is returned instead, e.g. { "jsonrpc": "2.0", "id": "1", "error": { "code": -32600, "message": "Invalid JSON-RPC Request." } }.