Setup
Agent Card
The server automatically generates an Agent Card at/.well-known/agent.json:
JSON-RPC Methods
The server handles these A2A methods at thebasePath:
message/send
Synchronous request/response. Runs the agent and returns the complete result.message/stream
Server-Sent Events (SSE) streaming. Returns chunks as the agent generates output.tasks/get
Retrieve a task by ID, optionally limiting history length.tasks/cancel
Cancel a running task.Agent Routing
When multiple agents are registered, the server resolves which agent to use:- Explicit — Set
metadata.agentNamein the message to target a specific agent - Name matching — The server checks if the message text mentions an agent name
- Default — Falls back to the first registered agent
Examples
A2ARemoteAgent from @agentium/core for the legacy client; see client configuration. Use A2AV1Client with the separate A2A 1.0 server.
Task Lifecycle
Each request creates a task that transitions through these states:Configuration
Record<string, Agent>
required
Map of agent name to Agent instance.
string
default:"/"
Base path for the JSON-RPC endpoint.
object
Provider information included in the Agent Card.
organization(string) — Organization nameurl(string) — Organization URL
string
default:"1.0.0"
Version string for the Agent Card.