A2A endpoints & methods
Overview
All Warden Agents are immediately compatible with the A2A protocol, supporting the Agent Card and the JSON-RPC endpoint with the core methods.
To learn more, see the A2A specification.
For usage examples, see Test the Agent locally and Host your Agent.
Get Agent Card
| Name | Method | Endpoint |
|---|---|---|
| Get Agent Card | GET | /.well-known/agent-card.json |
An A2A Agent Card is a JSON file that describes your Agent's capabilities. It enables clients and other Agents to discover and understand what the Agent can do.
You can change this metadata at any moment, as explained in Update the Agent Card.
Typically, Agent Cards look like this:
{
"name": "general-test",
"description": "A helpful AI agent named general-test",
"url": "http://localhost:3000",
"version": "0.1.0",
"capabilities": {
"streaming": true,
"multiTurn": false
},
"skills": [],
"defaultInputModes": [
"text"
],
"defaultOutputModes": [
"text"
]
}
JSON-RPC endpoint
The A2A JSON-RPC endpoint allows initiating various A2A operations such as sending messages and managing tasks. It uses just the base URL:
| Name | Method | Endpoint |
|---|---|---|
| A2A JSON-RPC | POST | / |
To run a particular A2A method, specify it in the JSON-RPC request body:
| Name | JSON-RPC method |
|---|---|
| Send Message | message/send |
| Send Streaming Message | message/stream |
| Get Task | tasks/get |
| Cancel Task | tasks/cancel |
| Subscribe to Task | tasks/resubscribe |
You can find detailed descriptions of each method in the sections below.
Send Message
- Postman
- cURL
POST BASE_URL
Headers: Content-Type: application/json
Authorization: Type: Bearer Token, Token: AGENT_API_KEY
Body:
{
"jsonrpc": "2.0",
"id": "",
"method": "message/send",
"params": {
"message": {
"role": "user",
"parts": [
{
"kind": "text",
"text": "PROMPT_TEXT"
}
],
"messageId": ""
},
"thread": {
"threadId": ""
}
}
}
curl BASE_URL \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer AGENT_API_KEY' \
--data '{
"jsonrpc": "2.0",
"id": "",
"method": "message/send",
"params": {
"message": {
"role": "user",
"parts": [
{
"kind": "text",
"text": "PROMPT_TEXT"
}
],
"messageId": ""
},
"thread": {
"threadId": ""
}
}
}'
This method returns a result object containing the LLM response, conversation history, and execution status. Task methods require the task ID, which is returned as result.id.
Send Streaming Message
- Postman
- cURL
POST BASE_URL
Headers: Content-Type: application/json
Authorization: Type: Bearer Token, Token: AGENT_API_KEY
Body:
{
"jsonrpc": "2.0",
"id": "",
"method": "message/stream",
"params": {
"message": {
"role": "user",
"parts": [
{
"kind": "text",
"text": "PROMPT_TEXT"
}
],
"messageId": ""
},
"thread": {
"threadId": ""
}
}
}
curl BASE_URL \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer AGENT_API_KEY' \
--data '{
"jsonrpc": "2.0",
"id": "",
"method": "message/stream",
"params": {
"message": {
"role": "user",
"parts": [
{
"kind": "text",
"text": "PROMPT_TEXT"
}
],
"messageId": ""
},
"thread": {
"threadId": ""
}
}
}'
This method streams task status updates. When the response is ready, the stream includes the generated LLM message. Task methods require the task ID, which is returned as result.id.
Get Task
- Postman
- cURL
POST BASE_URL
Headers: Content-Type: application/json
Authorization: Type: Bearer Token, Token: AGENT_API_KEY
Body:
{
"jsonrpc": "2.0",
"id": "",
"method": "tasks/get",
"params": {
"id": ""
}
}
curl BASE_URL \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer AGENT_API_KEY' \
--data '{
"jsonrpc": "2.0",
"id": "",
"method": "tasks/get",
"params": {
"id": "TASK_ID"
}
}'
In params.id, specify the task ID. You can obtain this value from result.id, returned by Send Message or Send Streaming Message.
Cancel Task
- Postman
- cURL
POST BASE_URL
Headers: Content-Type: application/json
Authorization: Type: Bearer Token, Token: AGENT_API_KEY
Body:
{
"jsonrpc": "2.0",
"id": "",
"method": "tasks/cancel",
"params": {
"id": "TASK_ID"
}
}
curl BASE_URL \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer AGENT_API_KEY' \
--data '{
"jsonrpc": "2.0",
"id": "",
"method": "tasks/cancel",
"params": {
"id": "TASK_ID"
}
}'
In params.id, specify the task ID. You can obtain this value from result.id, returned by Send Message or Send Streaming Message.
Subscribe to Task
- Postman
- cURL
POST BASE_URL
Headers: Content-Type: application/json
Authorization: Type: Bearer Token, Token: AGENT_API_KEY
Body:
{
"jsonrpc": "2.0",
"id": "",
"method": "tasks/resubscribe",
"params": {
"id": "TASK_ID"
}
}
curl BASE_URL \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer AGENT_API_KEY' \
--data '{
"jsonrpc": "2.0",
"id": "",
"method": "tasks/resubscribe",
"params": {
"id": "TASK_ID"
}
}'
In params.id, specify the task ID. You can obtain this value from result.id, returned by Send Message or Send Streaming Message.