Tool call
One row per agent tool call. While it runs the label shimmers and a clock counts; then it lands on a check or an error. Open it to read the arguments as they stream and the result.
npx shadcn@latest add @captain/tool-callread_file finished
run failed
Arguments edit_file
No argumentsTool 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. Highlighted 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. | |
| 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; the text and clock remain.