# `ALLM.ToolCall`
[🔗](https://github.com/cykod/ALLM/blob/v0.3.0/lib/allm/tool_call.ex#L1)

A provider-emitted tool call. See spec §5.3.

Layer A — pure serializable data. Carries the provider-assigned `:id` the
model uses to match the eventual tool-role message back to this call, the
`:name` of the tool to invoke, and the parsed `:arguments` map. The original
provider JSON is preserved on `:raw_arguments` so adapters that need the
exact wire string (streaming reassembly, audit logs) can recover it.

# `t`

```elixir
@type t() :: %ALLM.ToolCall{
  arguments: map(),
  id: String.t(),
  metadata: map(),
  name: String.t(),
  raw_arguments: String.t() | nil
}
```

# `new`

```elixir
@spec new(keyword()) :: t()
```

Build a `%ToolCall{}` from keyword opts.

`:id`, `:name`, and `:arguments` are required; omitting any raises
`ArgumentError` via `struct!/2`. Optional fields: `:raw_arguments`,
`:metadata`.

## Examples

    iex> ALLM.ToolCall.new(id: "call_1", name: "weather", arguments: %{"city" => "SFO"})
    %ALLM.ToolCall{id: "call_1", name: "weather", arguments: %{"city" => "SFO"}, raw_arguments: nil, metadata: %{}}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
