Captain UI

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-call
Pro
read_file finished
run failed

Arguments edit_file

No arguments

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

PropTypeDefaultWhat it does
namestringThe tool's name, e.g. edit_file.
titleReactNodeWhat it is doing, in words.
status"running" | "success" | "error"Running shimmers and counts; the others settle on a glyph.
argsobject | stringAn object, or a partial JSON string while it streams. Highlighted either way.
resultunknownShown as highlighted JSON on success.
errorReactNodeShown in the danger colour on error.
startedAtnumberms since epoch; drives the live clock.
durationnumberFinal duration in ms.
open / defaultOpenbooleanExpanded 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.