The block an agent renders when it invokes a tool — search, calculation, API call, function. Four states cover the lifecycle: running, success, error, and the default collapsed summary. All four reuse agent-artifact-ui with the kind="TOOL" badge; tone shifts on outcome.
Whenever an agent calls a function and the user benefits from seeing
what the call did. The block is more compact than a full chat reply
and stays visually distinct from prose, so a thread of mixed
text-plus-tool-calls remains scannable. For multi-step tool runs,
pair this with agent-reasoning-ui above and
agent-trace-ui below for the full lineage.
In-progress invocation. tone="neutral" with a progress-ui indeterminate strip in the body. No action buttons until the call resolves.
tone="accent" on resolution. Body shows the call args + a result preview (truncated when long). Secondary slot carries copy / open-in-new-tab actions.
claude opus tool use latencytone="danger" with a clear next-step. The body carries the call args plus the error message in an alert-ui; secondary slot offers retry.
inv_8421 in the last 90 days. Check the id or widen the date range.Default state inside a long thread — the agent has many tool calls and most don't need detail. Header carries the tool name + result count or status; body expands on click. Use collapsed attribute.
kind="TOOL" for the badge — distinguishes tool blocks from A2UI artifacts, tickets, notes, etc.neutral while running, accent on success, danger on error. Don't use warning here; reserve that for soft warnings (rate-limit nearing, deprecated tool).· + result count or short status.code-ui block, then result. The reverse hides the call from the user; an agent thread is a contract, not an output stream.slot="secondary"; success gets Copy / Open. Don't double-up.