Helper module used to build ToolUseContent structure: a request of the
model to call a tool, inside a sampling message.
(MCP protocol: 2025-11-25)
Short example:
%ToolUseContent{}
|> ToolUseContent.id("call_1")
|> ToolUseContent.name("get_weather")
|> ToolUseContent.input(%{"city" => "Paris"})
|> ToolUseContent.build()Result:
%{type: "tool_use", id: "call_1", name: "get_weather", input: %{"city" => "Paris"}}Specification: ToolUseContent
Fields
| Field | Setter | Type | Required |
|---|---|---|---|
id | id/2 | string | yes |
name | name/2 | string | yes |
_meta | _meta/2 | map | no |
input | input/2 | map | yes |