Skip to main content
A2A (Agent-to-Agent) protocol endpoints for agents deployed via A2A(agent).get_router().

Base URL

http://localhost:{port}
Default port is 8000.

Endpoints

GET /.well-known/agent.json

Retrieve the Agent Card for discovery. Request:
curl http://localhost:8000/.well-known/agent.json
Response:
{
  "name": "Assistant",
  "description": "Helpful AI Assistant",
  "url": "http://localhost:8000/a2a",
  "version": "1.0.0",
  "capabilities": {
    "streaming": true,
    "pushNotifications": false,
    "stateTransitionHistory": false
  },
  "skills": [
    {
      "id": "chat",
      "name": "Chat",
      "description": "General conversation"
    }
  ]
}

GET /status

Check server status. Request:
curl http://localhost:8000/status
Response:
{
  "status": "ok",
  "name": "Assistant",
  "version": "1.0.0"
}

POST /a2a

Send JSON-RPC messages to the agent. Request:
curl -X POST http://localhost:8000/a2a \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "message/send",
    "id": "request-123",
    "params": {
      "message": {
        "role": "user",
        "parts": [
          {"type": "text", "text": "Hello, agent!"}
        ]
      }
    }
  }'
Response:
{
  "jsonrpc": "2.0",
  "id": "request-123",
  "result": {
    "message": {
      "role": "agent",
      "parts": [
        {"type": "text", "text": "Hello! How can I help you today?"}
      ]
    }
  }
}

A2A Methods

message/send

Send a message to the agent. Request Body:
FieldTypeRequiredDescription
jsonrpcstringYesMust be “2.0”
methodstringYesMust be “message/send”
idstringYesRequest ID
params.message.rolestringYes”user”
params.message.partsarrayYesMessage parts
Message Part Types:
TypeFieldsDescription
texttextPlain text content
fileuri, mimeTypeFile attachment

Error Responses

A2A errors follow JSON-RPC 2.0 format:
{
  "jsonrpc": "2.0",
  "id": "request-123",
  "error": {
    "code": -32600,
    "message": "Invalid request"
  }
}
CodeMessage
-32700Parse error
-32600Invalid request
-32601Method not found
-32602Invalid params
-32603Internal error

Python Client

import requests

# Get Agent Card
response = requests.get("http://localhost:8000/.well-known/agent.json")
agent_card = response.json()
print(f"Agent: {agent_card['name']}")
print(f"URL: {agent_card['url']}")

# Send Message
message = {
    "jsonrpc": "2.0",
    "method": "message/send",
    "id": "1",
    "params": {
        "message": {
            "role": "user",
            "parts": [{"type": "text", "text": "Hello!"}]
        }
    }
}
response = requests.post("http://localhost:8000/a2a", json=message)
result = response.json()["result"]
print(f"Agent response: {result['message']['parts'][0]['text']}")

JavaScript Client

// Get Agent Card
const cardResponse = await fetch('http://localhost:8000/.well-known/agent.json');
const agentCard = await cardResponse.json();
console.log(`Agent: ${agentCard.name}`);

// Send Message
const message = {
  jsonrpc: '2.0',
  method: 'message/send',
  id: '1',
  params: {
    message: {
      role: 'user',
      parts: [{ type: 'text', text: 'Hello!' }]
    }
  }
};

const response = await fetch('http://localhost:8000/a2a', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify(message)
});

const result = await response.json();
console.log(`Agent response: ${result.result.message.parts[0].text}`);