# `Raxol.AgentClientProtocol.Schema.ToolCall`
[🔗](https://github.com/DROOdotFOO/raxol-agent/blob/raxol_agent_client_protocol-v0.1.0/packages/raxol_agent_client_protocol/lib/raxol/agent_client_protocol/schema/tool_call.ex#L525)

Represents a tool call that the language model has requested. Every other
type ported from `tool_call.ex` (`ToolKind`, `ToolCallStatus`,
`ToolCallLocation`, `Diff`, `ToolCallTerminal`, `ToolCallContentWrapper`,
`ToolCallContent`, `ToolCallUpdateFields`, `ToolCallUpdate`) is a separate,
bare `Schema.*` module, not nested under this one.

`kind` and `status` default (`:other` / `:pending`) rather than erroring
on an unrecognized wire value; `content` and `locations` default to `[]`
and skip items that individually fail to decode.

Ported from the MIT `f1729/agent_client_protocol` (c) 2025 f1729; see NOTICE.md.

# `t`

```elixir
@type t() :: %Raxol.AgentClientProtocol.Schema.ToolCall{
  _meta: map(),
  content: [Raxol.AgentClientProtocol.Schema.ToolCallContent.t()],
  kind: Raxol.AgentClientProtocol.Schema.ToolKind.t(),
  locations: [Raxol.AgentClientProtocol.Schema.ToolCallLocation.t()],
  raw_input: term() | nil,
  raw_output: term() | nil,
  status: Raxol.AgentClientProtocol.Schema.ToolCallStatus.t(),
  title: String.t(),
  tool_call_id: String.t()
}
```

# `from_json`

```elixir
@spec from_json(term()) :: {:ok, t()} | {:error, term()}
```

Total: never raises. Missing/non-string `toolCallId` or `title` is the
only failure mode (the two required fields); everything else defaults
leniently per the schema.

# `new`

```elixir
@spec new(String.t(), String.t()) :: t()
```

# `to_json`

```elixir
@spec to_json(t()) :: map()
```

# `to_update`

```elixir
@spec to_update(t()) :: Raxol.AgentClientProtocol.Schema.ToolCallUpdate.t()
```

Project this `ToolCall` down to a `ToolCallUpdate` carrying its full current state.

# `update`

```elixir
@spec update(t(), Raxol.AgentClientProtocol.Schema.ToolCallUpdateFields.t()) :: t()
```

Apply a partial update, overwriting only the fields present (non-nil) in `fields`.

---

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