Tool Calls
A small “3 tools used” line under an AI reply. Click it to see each step the agent took and whether it's still running, finished or failed.
Preview
- Searched customers
Three contracts renew this month: Vertex Systems, Apex Dynamics and Elevate Digital.
Setup
Install with the shadcn CLI
One command adds every file, the npm packages and any Kinetik components it builds on. Needs a components.json; the CLI offers to create one if your project has none.
Or install manually
- 1
Run in your terminal:
$npm install clsx tailwind-merge framer-motion lucide-react - 2
Copy
lib/utils.tsfrom the Code tab. Skip if you already havecn(). - 3
Copy
styles/tokens.cssfrom the Code tab and import it in your global CSS after Tailwind:@import "./styles/tokens.css"; - 4
Create a
components/ui/tool-calls/folder and copy every file from the Code tab into it. Each file does one job, so you can read or change a piece without the rest. - 5
Import and render:
Exampleimport { ToolCalls } from "@/components/ui/tool-calls" <ToolCalls calls={["Searched customers", "Sorted by size"]} />
Usage
The simplest version is a list of names. They all show as done:
import { ToolCalls } from "@/components/ui/tool-calls"
<ToolCalls calls={["Searched customers", "Sorted by employees"]} />To show progress while your agent works, pass objects with a status. While anything is still
running, the line reads “Using 2 tools…” instead of “2 tools used”:
<ToolCalls
calls={[
{ name: "Searched customers", status: "done" },
{ name: "Read 3 contracts", status: "running", detail: "Vertex, Apex and Elevate" },
]}
/>| Status | Shows |
|---|---|
"running" | A spinner |
"done" | A green check |
"error" | A red cross |
Put it right above the reply text. Pass defaultOpen to show the list open, and icon to use
your own icon instead of the sparkle.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
calls | (string | ToolCall)[] | — | Each step: a name, or { name, status, detail }. |
defaultOpen | boolean | false | Start with the list open. |
icon | ReactNode | sparkle | Icon before the summary. |
Accessibility
- The summary is a button that says whether the list is open (
aria-expanded) - Each status icon has a label: Running, Done or Failed