One tool call by an agent on a single line: the tool, its argument, what it is for, how long it took and whether it worked. Open it for the details and output.
const user = await getUser(session) const projects = await getProjects(user.id) const activity = await getActivity(user.id) const billing = await getBilling(user.id)
pnpm dlx shadcn@latest add @latheui/tool-runPart of Lathe Pro. Set up your project once with your license key: npx latheui init --key <key>. See Lathe Pro.
Tool Run is part of Lathe Pro
The preview is live and free to try. The source, the install and every assembly come with Pro: $79 once, with lifetime updates.
Depends on
Also accepts native div attributes. formatDuration(ms) is exported too.
| Prop | Type | Default | Description |
|---|---|---|---|
| name* (required) | string | — | The tool, such as read_file. |
| argument | string | — | Its main argument, shown in brackets. |
| description | string | — | What the call is for. It shimmers while running. |
| status* (required) | "pending" | "running" | "done" | "error" | — | Shown as a badge on the icon; a failed call's name turns red. |
| duration | number | — | Milliseconds it took, shown once it has finished. |
| icon | ReactNode | — | The tool's icon. A terminal when left out. |
| meta | { label: string; value: string }[] | — | Small facts shown when open, such as the path and lines. |
| output | string | — | The result, shown as code when open. |
| error | string | — | Why it failed, shown when open. |
| children | ReactNode | — | Anything else to show when open. |
| open | boolean | — | Whether the details show, when controlled. |
| defaultOpen | boolean | false | Starting state. |
| onOpenChange | (open: boolean) => void | — | Called when the line is pressed. |
<ToolRun name="screenshot" argument="/checkout" status="done" duration={1200}>
<img src={url} alt="The checkout page" className="rounded-lg border" />
</ToolRun>