A tool advertised by one server, as the client holds it.
raw is the server's string-keyed tool definition, untouched: it is what
fingerprints are computed over and what LLM adapters read, and it keeps
keys this struct does not lift (icons, future fields). The other fields
are read-only conveniences lifted from raw:
name,title,descriptioninput_schema(inputSchema),output_schema(outputSchema)annotations- hints only. They are untrusted unless the server is configured as trusted, and never drive policy on their own.execution- legacy task support (execution.taskSupport)meta- the tool's_meta, or%{}
server_id is the operator-assigned id of the server that listed the tool
(never the self-reported serverInfo.name). fingerprint is the digest the
client pins approvals to; it is nil until the caller sets it.
Summary
Functions
The display name, by the spec's precedence: title, then
annotations.title, then name.
Builds a Tool from a wire Tool definition listed by server_id.
Types
Functions
The display name, by the spec's precedence: title, then
annotations.title, then name.
@spec from_wire(String.t(), term(), keyword()) :: {:ok, t()} | {:error, ConduitMcp.Client.Error.t()}
Builds a Tool from a wire Tool definition listed by server_id.
name must be a string and inputSchema an object; anything else is a
:protocol error with reason :invalid_tool. This checks shape only: the
name charset and x-mcp-header rules are enforced at tool intake.
Options
:fingerprint- the value for thefingerprintfield (defaultnil).
Example
iex> {:ok, tool} =
...> ConduitMcp.Client.Tool.from_wire("files", %{
...> "name" => "read",
...> "inputSchema" => %{"type" => "object"}
...> })
iex> {tool.server_id, tool.name}
{"files", "read"}