Tool call
The JSON unfolds as it streams. Keys arrive as a tree, an object opens as its brace arrives and closes when it ends, and strings type in place, so you watch the structure form instead of a wall of text.
npx shadcn@latest add @uimaxxer/tool-callPasskeysFix the duplicate Stripe charge
Fix the rounding in totalFor() so 0.005 goes to the even cent.
Captain
read_file finished
run failed
edit_file()Tool call is a Pro component
The demo and the docs are free. The source comes with Pro, through this page, the shadcn CLI and the MCP.
Usage
import { ToolCall } from "@/components/ui/tool-call"
<ToolCall
name="edit_file"
title="Editing billing/invoice.ts"
status="running"
startedAt={call.startedAt}
args={call.partialJson}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| name | string | The tool's name, e.g. edit_file. | |
| title | ReactNode | What it is doing, in words. | |
| status | "running" | "success" | "error" | Running shimmers and counts; the others settle on a glyph. | |
| args | object | string | An object, or a partial JSON string while it streams. Parsed tolerantly and drawn as a tree either way. | |
| result | unknown | Shown as highlighted JSON on success. | |
| error | ReactNode | Shown in the danger colour on error. | |
| startedAt | number | ms since epoch; drives the live clock. | |
| duration | number | Final duration in ms. | |
| elapsed | number | ms shown on the clock instead of a live count, for replays. | |
| open / defaultOpen | boolean | Expanded state. |
Keyboard
- Enter / Space
- Open or close
Accessibility
- The row is a button with aria-expanded and aria-controls.
- Finishing or failing is announced in a polite live region.
- Under reduced motion the shimmer and spinner stop and rows appear without unfolding; the text and clock remain.
- The parser never throws: a cut mid-key, mid-escape or mid-number shows what has arrived.