The tools offered to an LLM, keyed by the name the model sees.
Built by ConduitMcp.Client.Naming.build/2. Every exposed name matches
^[A-Za-z0-9_-]{1,64}$ (valid for Anthropic, OpenAI and Gemini) and maps
to exactly one ConduitMcp.Client.Tool.
Reverse lookup is a table lookup (resolve/2 is a Map.fetch/2): an
exposed name is never split back into a server id and a tool name, so a
tool name containing __ cannot be used to reach another server's tool.
entries keeps the build order (servers in the given order, then each
server's tools in listed order), which keeps the provider tool list stable
between turns and so helps prompt caching.
Summary
Functions
The {exposed_name, tool} pairs, in build order.
The exposed name of server_id's tool tool_name, if it is in the set.
The exposed names, in build order.
Builds a toolset from ordered {exposed_name, tool} pairs.
Looks up the tool behind a model-issued name.
The number of tools in the set.
Types
@type exposed_name() :: String.t()
@type t() :: %ConduitMcp.Client.ToolSet{ by_name: %{required(exposed_name()) => ConduitMcp.Client.Tool.t()}, by_tool: %{required({String.t(), String.t()}) => exposed_name()}, entries: [{exposed_name(), ConduitMcp.Client.Tool.t()}] }
Functions
@spec entries(t()) :: [{exposed_name(), ConduitMcp.Client.Tool.t()}]
The {exposed_name, tool} pairs, in build order.
@spec exposed_name(t(), String.t(), String.t()) :: {:ok, exposed_name()} | :error
The exposed name of server_id's tool tool_name, if it is in the set.
@spec names(t()) :: [exposed_name()]
The exposed names, in build order.
@spec new([{exposed_name(), ConduitMcp.Client.Tool.t()}]) :: t()
Builds a toolset from ordered {exposed_name, tool} pairs.
Exposed names must be unique; ConduitMcp.Client.Naming.build/2 guarantees
that, so call this directly only with names you have already deduplicated.
Raises ArgumentError on a duplicate exposed name.
@spec resolve(t(), term()) :: {:ok, ConduitMcp.Client.Tool.t()} | :error
Looks up the tool behind a model-issued name.
:error means the name is unknown: the caller answers the model with an
error result and sends nothing to any server.
@spec size(t()) :: non_neg_integer()
The number of tools in the set.