Ballmac UI home

Tool Call CardPRO

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.

7/7 checksv1.1.0Updated Oct 25, 2026Ships with a test
What changed
  1. 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.
  2. 1.0.0 Sep 28, 2026First release.

Update without losing your edits

Success842ms
Input
query
install a component into a src/ project
limit
3
Result
[
  {
    "title": "Installation",
    "url": "/docs/installation"
  },
  {
    "title": "CLI & registry",
    "url": "/docs/registry"
  }
]

Installation

  1. 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.

  2. 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.local
    BALLMAC_LICENSE_KEY=your-licence-key
  3. Add 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

Pending
Running
Success214ms
Error3.1s

A failed call with Retry

Error3.0s
Input
order
A-9914
amount
340
Error
Stripe returned 503: the service is unavailable. Nothing was refunded.

API reference

<ToolCallStatusBadge>

PropTypeDefault
status*

The tool call's lifecycle state. Rendered as an icon plus text, never color alone.

ToolCallStatus—

<ToolCallCard>

PropTypeDefault
name*

Tool name, shown in monospace, for example "search_docs".

string—
status

Lifecycle state of the call.

ToolCallStatus"pending"
duration

How long the call took, in milliseconds.

number—
input

Arguments the model passed. Objects are pretty-printed as JSON; strings are shown as-is.

unknown—
result

What the tool returned, or the error message when status is "error".

unknown—
description

Short human description shown under the name.

React.ReactNode—
server

Where the tool lives, for example "stripe" for an MCP server. Shown as a small tag after the name.

string—
icon

An icon or logo for the tool, shown in a tile in place of the wrench.

React.ReactNode—
onRetry

Adds a Retry button to a failed call. Reject and the card says why.

() => void | Promise<void>—
open

Controlled open state of the details panel.

boolean—
defaultOpen

Initial open state when uncontrolled.

booleanfalse
onOpenChange

Called when the details panel opens or closes.

(open: boolean) => void—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Enter / SpaceOn the tool name, opens or closes the input and result (aria-expanded)
TabFocuses 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

7/7

Every applicable check passes

Measured in Chromium 153.0.8010.12 on October 19, 2026, on version 1.0.0, across 2 examples.

How we measure

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.