# `MingaAgent.Hooks.PreToolUsePayload`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_agent/hooks/pre_tool_use_payload.ex#L1)

Public payload passed to `PreToolUse` hooks.

The shell runner encodes this payload as JSON and writes it to the hook
command's standard input. Keep field names stable because user scripts may
depend on them.

# `t`

```elixir
@type t() :: %MingaAgent.Hooks.PreToolUsePayload{
  arguments: map(),
  event: String.t(),
  tool_call_id: String.t(),
  tool_name: String.t()
}
```

Payload for a tool call about to execute.

# `new`

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

Builds a payload from a native provider or runtime tool call map.

# `new`

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

Builds a payload from explicit tool call fields.

# `to_map`

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

Converts the payload to the JSON object shape used on stdin.

---

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