Shows one agent tool call: the tool name, a pending, running, success or error status with icon and text, duration, and collapsible pretty-printed input and result.
What changed
- 1.1.0 Oct 25, 2026A status strip, an icon tile and a server tag; flat inputs listed as keys and values; Copy on input and result; a moving line while running; a Denied status; and Retry on a failed call. New props: server, icon, onRetry.
- 1.0.0 Sep 28, 2026First release.
The source is part of Ballmac UI Pro.
Log in with your licence key to read and copy it here, or install it through the shadcn CLI or the MCP server. You own the code once it is in your project.
$49 once regular price $99for this and every other Pro item. Tax included.Money back if it does not work.
Installation
Get a Pro licence key.
The source is part of Ballmac UI Pro.
Log in with your licence key to read and copy it here, or install it through the shadcn CLI or the MCP server. You own the code once it is in your project.
$49 once
regular price $99for this and every other Pro item. Tax included.Money back if it does not work.Once per project: add the Pro registry and your licence key.
components.json{ "registries": { "@ballmac": "https://ui.ballmac.com/r/{name}.json", "@ballmac-pro": { "url": "https://ui.ballmac.com/r/pro/{name}.json", "headers": { "Authorization": "Bearer ${BALLMAC_LICENSE_KEY}" } } } }.env.localBALLMAC_LICENSE_KEY=your-licence-keyAdd it.
$ pnpm dlx shadcn@latest add @ballmac-pro/tool-call-card
Usage
import { ToolCallCard, ToolCallStatusBadge, formatToolDuration } from "@/components/ballmac/tool-call-card"The full example is in the Code tab above.
Examples
All states
The source is part of Ballmac UI Pro.
Log in with your licence key to read and copy it here, or install it through the shadcn CLI or the MCP server. You own the code once it is in your project.
$49 once regular price $99for this and every other Pro item. Tax included.Money back if it does not work.
A failed call with Retry
The source is part of Ballmac UI Pro.
Log in with your licence key to read and copy it here, or install it through the shadcn CLI or the MCP server. You own the code once it is in your project.
$49 once regular price $99for this and every other Pro item. Tax included.Money back if it does not work.
API reference
<ToolCallStatusBadge>
| Prop | Type | Default |
|---|---|---|
status*The tool call's lifecycle state. Rendered as an icon plus text, never color alone. | ToolCallStatus | — |
<ToolCallCard>
| Prop | Type | Default |
|---|---|---|
name*Tool name, shown in monospace, for example "search_docs". | string | — |
statusLifecycle state of the call. | ToolCallStatus | "pending" |
durationHow long the call took, in milliseconds. | number | — |
inputArguments the model passed. Objects are pretty-printed as JSON; strings are shown as-is. | unknown | — |
resultWhat the tool returned, or the error message when status is "error". | unknown | — |
descriptionShort human description shown under the name. | React.ReactNode | — |
serverWhere the tool lives, for example "stripe" for an MCP server. Shown as a small tag after the name. | string | — |
iconAn icon or logo for the tool, shown in a tile in place of the wrench. | React.ReactNode | — |
onRetryAdds a Retry button to a failed call. Reject and the card says why. | () => void | Promise<void> | — |
openControlled open state of the details panel. | boolean | — |
defaultOpenInitial open state when uncontrolled. | boolean | false |
onOpenChangeCalled when the details panel opens or closes. | (open: boolean) => void | — |
Also accepts the standard attributes of its root element.
Accessibility
| Key | Action |
|---|---|
| Enter / Space | On the tool name, opens or closes the input and result (aria-expanded) |
| Tab | Focuses the scrollable input and result blocks so long JSON can be scrolled with the keyboard |
| — | Status changes are announced politely; status is always icon plus text |
Quality scorecard
Every applicable check passes
Measured in Chromium 153.0.8010.12 on October 19, 2026, on version 1.0.0, across 2 examples.
These numbers are from version 1.0.0. This page shows version 1.1.0, which is measured again on the next quality run.
Passed: Accessibility scan
No serious or critical issues in light and dark, on a phone and a desktop (axe-core 4.13.0, WCAG 2.1 AA and best-practice rules).
Passed: Small screens
No sideways scrolling at 360, 390 or 1280 px wide.
Passed: Reduced motion
Every endless animation stops when the visitor asks for less motion.
Passed: Right to left
Mirrors correctly in Arabic, Hebrew, Persian and Urdu layouts (0% of elements off the mirror, limit 15%).
Passed: Clean console
No console errors or React hydration errors while loading.
Passed: Keyboard
7 tab stops, each showing a visible change when it takes focus. 3 documented keys.
Not applicable: Loading, empty and error
Does not show data or take submissions.
Passed: Automated tests
Covered by tool-call-card.test.tsx.
For information: Footprint
2.4 KB of source (gzip) in 1 file. Installs lucide-react, radix-ui.
Automated checks find a subset of problems and do not replace testing with a screen reader and a keyboard in your own app. What they miss.
Use with AI
Render each tool invocation of an agent: <ToolCallCard name status duration input result />. status is pending | running | success | error | denied; server (a tag after the name), icon (a tile), onRetry (adds Retry to a failed call; reject and it says why). An input object with only plain values is listed as keys and values; each block has a Copy button. Objects are shown as indented JSON, strings as-is; the details panel is a disclosure (collapsed by default). With the shadcn MCP server set up (guide), ask your agent:
Add the Ballmac UI Tool Call Card (@ballmac-pro/tool-call-card) to this project with the shadcn MCP, then use it where it fits.
Use it for
- Showing function/tool calls inside an assistant message
- Agent run logs where each step calls a tool and returns data
- Debug views for MCP tool calls
Not for
- Generic key/value data (use a table or description list)
- Long source files (use code-block)
Registry JSON (needs your licence key): https://ui.ballmac.com/r/pro/tool-call-card.json
Credits
Covered by the Ballmac UI Pro license.
Pairs well with
AI Message
A chat message with user, assistant and system roles: right-aligned user bubbles, full-width assistant prose, an avatar slot, hover-revealed actions and a hydration-safe timestamp.
AI Chat
The layout for a chat UI: a message log that sticks to the bottom while replies stream unless the reader scrolls up, a jump-to-latest button, an empty state with suggestions and a footer.
Reasoning Disclosure
A collapsible 'thinking' panel for model reasoning: shows a shimmering 'Thinking…' while streaming, opens automatically, then collapses to 'Thought for 12s' when done.
Agent Roster
Every agent on a team of agents as a card: name and role, a status in words (working, waiting, blocked, idle, offline), what it is doing, a load meter and when it was last active, with status counts that filter the grid.