Skip to main content
The A2AController class provides a FastAPI-compatible router that implements the A2A (Agent-to-Agent) protocol v0.3.0. It automatically exposes an agent card manifest and handles JSON-RPC based messaging.

Class Signature

Parameters

name
str
default:"Agentor"
The name of the agent.
description
str
A description of the agent’s purpose and capabilities.
url
str
default:"http://0.0.0.0:8000"
The base URL where the agent is hosted.
version
str
default:"0.0.1"
The version of the agent.
skills
List[AgentSkill]
default:"[]"
A list of skills that the agent can perform.
capabilities
AgentCapabilities
The capabilities supported by the agent (streaming, statefulness, async processing).
**kwargs
dict
Additional keyword arguments passed to the FastAPI APIRouter.

Methods

add_handler

Register a handler function for a specific A2A protocol method.
method
Literal
The A2A protocol method to handle. Must be one of:
  • message/send - Non-streaming message handling
  • message/stream - Streaming message handling with Server-Sent Events
  • tasks/get - Retrieve task status
  • tasks/cancel - Cancel a running task
handler
Callable
An async function that processes the request and returns the appropriate response type.

get_handler

Retrieve the registered handler for a specific method.

run

Main JSON-RPC endpoint that routes requests to the appropriate handler.

Endpoints

The controller automatically exposes these endpoints:
  • GET /.well-known/agent-card.json - Returns the agent card manifest following A2A protocol v0.3.0
  • POST / - Main JSON-RPC endpoint for A2A protocol operations

Usage Example

Agent Card

The agent card is automatically generated and exposed at /.well-known/agent-card.json. It includes:
  • Agent metadata (name, description, version, URL)
  • Supported skills
  • Capabilities (streaming, statefulness, async processing)
  • Security schemes and authentication requirements
  • Supported input/output modes
Source: /home/daytona/workspace/source/src/agentor/a2a.py:20
Last modified on May 5, 2026