Skip to main content

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

NameMethodEndpoint
Get Agent CardGET/.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.

tip

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:

NameMethodEndpoint
A2A JSON-RPCPOST/

To run a particular A2A method, specify it in the JSON-RPC request body:

NameJSON-RPC method
Send Messagemessage/send
Send Streaming Messagemessage/stream
Get Tasktasks/get
Cancel Tasktasks/cancel
Subscribe to Tasktasks/resubscribe

You can find detailed descriptions of each method in the sections below.

Send Message

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": ""
}
}
}
tip

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

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": ""
}
}
}
tip

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

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": ""
}
}
tip

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

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"
}
}
tip

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

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"
}
}
tip

In params.id, specify the task ID. You can obtain this value from result.id, returned by Send Message or Send Streaming Message.