Skip to content
GitHub (opens in a new tab)

ToolCallCard

One agent tool call on one line: status, mono name, summary and a live timer. Opens to arguments and result; with calls it rolls several calls into one group row.

stableOrganismcontracts/toolcallcard.json

Preview

ToolCallCard

One tool call on one line. Not CodeSnippet. Not AgentTrail.

Master

A finished call, opened to show its arguments and result. Variants shows running, failed and grouped calls.

Arguments
{
  "query": "invoice total",
  "path": "src/billing",
  "limit": 20
}
  • read_fileinvoice.ts, Running

Usage

ToolCallCard logs one call an agent made. Show the real arguments. A call that needs an OK first is an ApprovalCard; a whole task is an AgentTrail.

Do's

  • show each tool an agent calls in a chat or a run log
  • let people inspect a call's arguments and result
  • roll a burst of calls into one row ("Ran 4 tools")
  • a failed call with Retry

Don'ts

  • a step list for a whole task — AgentTrail
  • a call that needs the person's OK first — ApprovalCard
  • plain code to copy — CodeSnippet
<ToolCallCard
  name="search_files"
  summary="3 matches in 2 files"
  status="done"
  duration="0.9s"
  args={args}
  result={lines}
  resultMeta="3 of 3"
  defaultExpanded
/>

When to use

  • show each tool an agent calls in a chat or a run log
  • let people inspect a call's arguments and result
  • roll a burst of calls into one row ("Ran 4 tools")
  • a failed call with Retry

When not to use

  • a step list for a whole task — AgentTrail
  • a call that needs the person's OK first — ApprovalCard
  • plain code to copy — CodeSnippet

What an agent reads

import { ToolCallCard } from "agentic-ds-kit";
must
  • the header is a button with aria-expanded and aria-controls when there is detail
  • status is named in text for screen readers; icons are aria-hidden
  • the live timer does not announce (aria-live off)
  • Retry is a kit Button
  • spinner and open motion use transform and opacity, plus a stroke draw when the card or a grouped call turns done or error live (a first load stays still), off under prefers-reduced-motion
  • The detail panel glides open (height and fade) on the enter motion timing; on close it folds, fades and blurs lightly on the exit timing, inert, then unmounts. No motion under prefers-reduced-motion
defaults
  • status done
  • variant default
stops if
  • Do not invent a local ToolCall, ToolRow, or FunctionCallCard
  • Do not paraphrase arguments; show them
  • Do not put an approval in a tool call; use ApprovalCard
  • Do not use raw hex for status colors

From contracts/toolcallcard.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
namestringNo—Tool name in mono, e.g. "search_files". Required unless calls is set.
summarystringNo—One line: query, target or outcome. Truncates.
statusrunning | done | errorNodoneerror shows the word "Failed" with the CircleX icon, the same status words as the other run components.
durationstringNo—e.g. "0.4s".
startedAtnumberNo—Epoch ms. A running call ticks a live timer from it.
argsunknownNo—Object → pretty JSON; string → as is.
resultstring | string[]No——
resultMetastringNo—Result header note, e.g. "3 of 3".
errorstring | string[]No—Error lines; an error card opens by default.
onRetryfunctionNo—Shows Retry (outline) in the open panel.
attemptobjectNo—{ n, max } → "Attempt 1 of 3".
callsarrayNo—Group mode: { id, name, summary?, status, duration? }[]. Header sums done / running / failed.
groupTitlestringNo—Default "Ran N tools".
expandedbooleanNo—Controlled open state.
defaultExpandedbooleanNo——
onExpandedChangefunctionNo—(expanded) => void
variantdefault | panelNodefaultpanel (RunDetail calls="all"): a 44 head with no status Badge (running reads "Running"), a grey body with white code boxes, Arguments and Result side by side (stacked below 40rem of card width), arrays of plain values on one line, the error box under Arguments, and Attempt left with Retry right (full width below 25rem). Ignored with calls.
  • Component
    →

    AgentTrail

    A vertical step list for a running agent task: done steps with durations, the current step with a live timer, then pending steps.

  • Component
    →

    ApprovalCard

    The agent asks before it acts: risk, what will happen in words, an exact preview of the command or diff, and Approve (⌘/Ctrl+Enter) / Deny (Escape) with an optional auto-deny countdown.

  • Component
    →

    CodeSnippet

    Read-only block of code with a copy button, optional title, language label, tabs, and line numbers.

  • Component
    →

    AgentPlan

    What an agent intends to do, before or during a run.