# `MimirAnalytics.Row.ToolCall`
[🔗](https://github.com/cash-mckeeman/mimir/blob/mimir_analytics-v0.8.1/mimir_analytics/lib/mimir_analytics/row/tool_call.ex#L1)

One row of `tool_calls` — a single custom/server tool use from a Capture
session result, or one occurrence of a `RunRecord` name/count roll-up.
`new/1` owns extracting `id`/`name`/`input` off the tool-use map (formerly
positional digs at the mapper call site) and defaulting `input` to `%{}`
when the tool use carried none.

A `RunRecord` carries no per-invocation tool-use data — only `%{name,
count}` roll-ups (the content boundary that struct enforces: arguments
never leave the producer). `Mappers.Session` expands each roll-up into
`count` occurrences, kind `"rollup"`, `tool_use_id` and `input` both
absent — this is the one place a `tool_calls` row carries no invocation
identity.

# `kind`

```elixir
@type kind() :: String.t()
```

# `t`

```elixir
@type t() :: %MimirAnalytics.Row.ToolCall{
  input: map(),
  kind: kind(),
  name: String.t() | nil,
  run_id: String.t(),
  seq: integer(),
  source_file: String.t(),
  tool_use_id: String.t() | nil,
  turn: integer() | nil
}
```

# `new`

```elixir
@spec new(%{
  run_id: String.t(),
  turn: integer() | nil,
  seq: integer(),
  tool_use: map(),
  kind: kind(),
  source_file: String.t()
}) :: t()
```

Build a `t()` from `run_id`, `seq`, the raw `tool_use` map
(`%{"id" => ..., "name" => ..., "input" => ...}`), its `kind`
(`"custom"`/`"server"`/`"rollup"`), and `source_file`.

---

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