ClaudeCode.Content.ToolUse (ClaudeCode v0.1.0)
View SourceRepresents a tool use content block within a Claude message.
Tool use blocks indicate that Claude wants to invoke a specific tool with the given parameters.
Summary
Functions
Creates a new ToolUse content block from JSON data.
Type guard to check if a value is a ToolUse content block.
Types
Functions
Creates a new ToolUse content block from JSON data.
Examples
iex> ToolUse.new(%{"type" => "tool_use", "id" => "123", "name" => "Read", "input" => %{}})
{:ok, %ToolUse{type: :tool_use, id: "123", name: "Read", input: %{}}}
iex> ToolUse.new(%{"type" => "text"})
{:error, :invalid_content_type}
Type guard to check if a value is a ToolUse content block.