Skip to content

Tool Call Card

Tool calls as quiet lines: the tool, what it did in plain words, a live timer and the status. Fold one open for the arguments and the result, copy either, and retry a failure in place. A group sums up a turn's calls in one line.

On this page
Used for
  • Show one tool call
  • Debug a failed call
  • Retry a call
  • Group calls in a reply
  • Inspect arguments and result

Examples

States

Standalone card

Show

Installation

npx knowns-ui@latest add tool-call-card
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

span
Span
The call: from, to, startedAt, endedAt?, outcome?, summary?, input?, output?, error?. No outcome means it is running.
run + spanId
AgentRun + string
Follow a call in a run; updates as it finishes.
actors
Actor[]
Default[]
Names and icons when no run is given. The called tool's label is the mono name and picks the logo.
variant
"line" | "card"
Default"line"
line: one row that folds open, for chat threads and lists. card: standalone, with who called whom on top and the details open.
name / icon
string / ReactNode
Defaulttool label / logo
Override the mono tool name or the 16px icon (a wrench when nothing matches).
open / defaultOpen / onOpenChange
boolean
Defaultopen on failure
Fold state. Uncontrolled lines open by themselves when the call fails; cards are open.
onRetry
(span) => void
Shows Retry next to the error on failed calls.
maxHeight
number
Default220
Arguments and result taller than this (px) are capped with a fade and Show more.
now
number
Defaultticks
Fixes the clock (tests, screenshots). By default the timer ticks while the call runs.
ToolCallGroup · spans / run + spanIds
Span[] / AgentRun
The calls of one turn, in order. With a run, all its spans unless spanIds picks some.
ToolCallGroup · label
ReactNode
DefaultUsed N tools · …
Header once nothing runs. The default sums up count, failures and wall time ("Used 3 tools · 1 failed · 2.6s"); while running it reads "Using 3 tools · 1 of 3 done".
ToolCallGroup · open / defaultOpen / onOpenChange
boolean
Defaultopen on failure
Folds the rows. A failure opens the group and the failed row.
ToolCallGroup · onRetry / maxHeight / now
-
Passed to every row.
a11y
buttons, alert
Every line is a button with aria-expanded and aria-controls; status is named (Running, Done, Failed); errors are role=alert; the group's summary is announced politely when the turn ends.

What it handles

  1. 01Reads one call from a span prop, or from a run by spanId, and shows the tool name, a timer and a status of running, success or failure.
  2. 02Folds open to the arguments and result as highlighted JSON, each with copy, and caps long values at maxHeight with a Show more button.
  3. 03Opens a failed call by itself, shows its error text, and puts a Retry link beside it when you pass onRetry.
  4. 04Counts whole seconds while a call runs and shows the exact time, such as 2.7s or 420ms, once it ends.
  5. 05Switches to variant="card" for a standalone view that is always open and names who called whom.
  6. 06Sums several calls in ToolCallGroup as one line like "Used 3 tools, 1 failed, 2.7s" that folds open to the calls.

States

First render
Nothing. The status mark and fold paint as they are
none
Call succeeds
The check draws itself
180ms, ease out
Call fails
The icon shakes once and the X draws
280ms, ease out
Fold opens
The detail grows from the row
180ms, ease out
Fold closes
The detail shrinks away
120ms, ease out
Chevron turns
It rotates a quarter turn
180ms, ease in-out
Row hover
The background tints
120ms, ease out
Reduced motion
The check, shake, fold and chevron do not animate
0ms

Works with

When to use

When to use

  • Tool calls inside a chat thread: one quiet line each, or a group that sums up the turn, folding open to arguments and result.
  • Letting the user retry a single failed call where it happened.
  • A details panel for one call (variant="card"), with who called whom.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Tool Call Card to my app and wire it to my own data.
  • I need tool calls inside a chat thread: one quiet line each, or a group that sums up the turn, folding open to arguments and result. Set that up with the Knowns UI Tool Call Card.
  • Which Tool Call Card props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "tool-call-card" }) and search_docs({ query: "tool call card" }).

Need help?

Stuck on Tool Call Card, or found something off? We read every message.