Normandy.A2A.Registry
(normandy v2.2.0)
View Source
Helpers for discovering remote A2A agents and registering them as tools.
Example
alias Normandy.A2A.Registry, as: A2ARegistry
alias Normandy.Tools.Toolset
registry = Toolset.new()
{:ok, registry} = A2ARegistry.discover_and_register(
registry,
"https://agent.example.com",
prefix: "research",
auth_token: "bearer-token"
):prefix is required: see Normandy.A2A.AgentTool's "Tool names" and "Trust".
Summary
Functions
Discovers a remote A2A agent and registers it as tool(s) in the toolset.
Creates AgentTool structs from a pre-fetched agent card.
Functions
@spec discover_and_register(Normandy.Tools.Toolset.t(), String.t(), keyword()) :: {:ok, Normandy.Tools.Toolset.t()} | {:error, term()}
Discovers a remote A2A agent and registers it as tool(s) in the toolset.
Creates one tool per skill if the agent has skills, or a single general tool if it has no skills.
:transport_opts is also used for discovery.
Options
:prefix(String.t/0orfalse) - Required. The remote's namespace: the tool is namedprefix__card_name. The rule ofNormandy.MCP.ToolWrapper.new/4's:prefix;"a2a"gives 1.x's names,falsethe bare card name.:auth_token(String.t/0) - A bearer token for the remote agent.:poll_interval(pos_integer/0) - Milliseconds between status requests while the remote's task is not finished. The call's timeout is the only bound on the wait. The default value is1000.:transport_opts(keyword/0) - Options for the A2A transport. Its:headers([{name, value}]) are sent on every request; with OpenTelemetry loaded and a span active, W3Ctraceparent/tracestateheaders are added beside them (a same-named header you set is kept). The default value is[].:timeout(pos_integer/0) - Each tool's registration timeout, in positive ms (Normandy.Tools.Toolset.register/3; 60_000 as in 1.x). The default value is60000.
@spec from_agent_card(Claudio.A2A.AgentCard.t(), String.t(), keyword()) :: [ Normandy.A2A.AgentTool.t() ]
Creates AgentTool structs from a pre-fetched agent card.
Returns one tool per skill, or a single general tool if no skills.
Options
:prefix(String.t/0orfalse) - Required. The remote's namespace: the tool is namedprefix__card_name. The rule ofNormandy.MCP.ToolWrapper.new/4's:prefix;"a2a"gives 1.x's names,falsethe bare card name.:auth_token(String.t/0) - A bearer token for the remote agent.:poll_interval(pos_integer/0) - Milliseconds between status requests while the remote's task is not finished. The call's timeout is the only bound on the wait. The default value is1000.:transport_opts(keyword/0) - Options for the A2A transport. Its:headers([{name, value}]) are sent on every request; with OpenTelemetry loaded and a span active, W3Ctraceparent/tracestateheaders are added beside them (a same-named header you set is kept). The default value is[].