Skip to main content

agentSwitch

Build a handoff directive that transfers control to another agent (by id). Return the result from a tool to switch the active agent mid-call; the target must be pre-registered via AgentOptions.agents.
to
string
required
Id of the agent to switch to.
opts
AgentSwitchOptions
returns
Record<string, any>

AgentCard

Create an AgentCard, filling unset fields with empty defaults.

Constructor

agentId
string
Unique identifier for this agent. Default: ''.
name
string
Human-readable agent name. Default: ''.
description
string
Short description of what the agent does. Default: ''.
capabilities
string[]
List of capability tags advertised by the agent. Default: [].
metadata
Record<string, any>
Arbitrary metadata to attach to the card. Default: {}.

A2AMessage

Create an A2AMessage. messageType defaults to 'text'.

Constructor

sourceAgentId
string
ID of the agent sending the message. Default: ''.
targetAgentId
string
ID of the agent the message is addressed to. Default: ''.
messageType
string
Message kind. Default: 'text'.
payload
Record<string, any>
Message body. Default: {}.