Tool Call Trail
An agent's tool calls drawn as a path, with a spark on the step running now.
PROGet Tool Call Trail and 168 other Pro components with pro lifetime — Get Pro
- Category
- Creative
- Access
- ProPro · unlocked
- Source
- 196 lines · one file
- States
- 6 drawn
The decision inside it
A failure stays where it happened
A failed call turns red with its reason and the line stops there, so the reader sees how far it got and why. A retry is a new step after it, not an overwrite: the failure keeps its mark and the line carries on. Only a running step gets the spark, so a stalled run looks stalled.
When to use it
Use Tool Call Trail to show an agent's run step by step: each tool call with its status, result or failure, and retries kept in order.
Installation
How you get it
Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.
Use Liro's Tool Call Trail for this.
Install it: npx shadcn@latest add @liro/tool-call-trail
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/tool-call-trail.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.
Usage
import { ToolCallTrail, type ToolStep } from "@/components/ui/tool-call-trail";
const steps: ToolStep[] = [
{ id: "a", tool: "search_docs", title: "Find the Q2 invoices", status: "done", detail: "6 invoices", duration: "0.8s" },
{ id: "b", tool: "read_ledger", title: "Read payments", status: "running" },
];
export function AgentRun() {
return <ToolCallTrail steps={steps} />;
}API reference
“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.
Props
Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.
| Type | Notes | ||
|---|---|---|---|
steps | ToolStep[] | Yes | – |
Dependencies
npm packages
clsxframer-motionlucide-reacttailwind-mergeLiro foundations, installed alongside it
liro-themeStates
All of them are drawn by the component. None is left for you to design.
- Pending
- Running
- Done
- Failed
- Retried
- Reduced motion
Accessibility
- Keyboard reachable throughout, in visual order
- Focus trapped in overlays, Escape closes them
- Focus returns to whatever opened it
- Live regions announce what changed, not that something did
- Honours prefers-reduced-motion
Responsive behavior
- Sizes to its container, not the viewport
- Usable from 320px up
- Pointer-based interaction, so trackpad and touch both work
- No hover-only affordances