OzMcp.Structs.ToolUseContent (OzMcp v0.9.0)

Copy Markdown View Source

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

FieldSetterTypeRequired
idid/2stringyes
namename/2stringyes
_meta_meta/2mapno
inputinput/2mapyes

Summary

Types

t()

@type t() :: %OzMcp.Structs.ToolUseContent{
  _meta: map() | nil,
  id: String.t(),
  input: map(),
  name: String.t()
}

Functions

build(struct)

@spec build(t()) :: map()

id(struct, value)

@spec id(t(), String.t()) :: t()

input(struct, value)

@spec input(t(), map()) :: t()

name(struct, value)

@spec name(t(), String.t()) :: t()