Helper module used to build ToolChoice structure: how the model uses the
tools of a sampling request.
(MCP protocol: 2025-11-25)
The mode is :auto (the model decides, the default of the client),
:required (the model must call a tool) or :none (the model must not).
Short example:
%ToolChoice{} |> ToolChoice.mode(:required) |> ToolChoice.build()Result:
%{mode: "required"}Specification: ToolChoice
Fields
| Field | Setter | Type | Required |
|---|---|---|---|
mode | mode/2 | mode() | String.t() | nil | no |