A single tool call in the agent conversation.
Tracks the tool's identity (id, name, args), its execution lifecycle (status, result, error state, timing), and display state (collapsed).
Mutation methods live here so consumers don't scatter %{tc | ...}
updates across 11 files. Each method encodes a domain transition:
complete/2 records the result and collapses the output, error/2
marks a failure, abort/1 handles user cancellation mid-execution.
Summary
Functions
Aborts a running tool call. Only transitions :running calls.
Marks the tool call as successfully completed, recording the result and duration.
Marks the tool call as failed, recording the error result and duration.
Returns true if the tool call has finished (complete or error).
Creates a new running tool call with a monotonic start timestamp.
Sets the collapsed state to a specific value.
Toggles the collapsed display state.
Updates the partial result during streaming, auto-expanding the display.
Types
@type status() :: :running | :complete | :error
Tool call execution status.
@type t() :: %MingaAgent.ToolCall{ args: map(), collapsed: boolean(), duration_ms: non_neg_integer() | nil, id: String.t(), is_error: boolean(), name: String.t(), result: String.t(), started_at: integer() | nil, status: status() }
A tool call.
Functions
Aborts a running tool call. Only transitions :running calls.
Marks the tool call as successfully completed, recording the result and duration.
Marks the tool call as failed, recording the error result and duration.
Returns true if the tool call has finished (complete or error).
Creates a new running tool call with a monotonic start timestamp.
Sets the collapsed state to a specific value.
Toggles the collapsed display state.
Updates the partial result during streaming, auto-expanding the display.