UI

Tools

Inline tool call rows and multi-call turn summaries for agent transcripts, with brand marks, structured outputs, approval, and retry.

import { ToolCall } from '@uthereal/ui/tool-call'

Tool call playground

Complete, 3 results, 1.2s
repo
acme/web
query
is:open label:release-blocker
  • #1284Checkout button stays disabled after coupon removalcheckout
  • #1291Webhook retry posts a second charge after a 504billing
  • #1297Safari address autofill skips postal code validationsafari
GitHub: Searched issues in acme/web. Complete, 3 results, 1.2s
Loading interactive preview…

Overview

ToolCall renders a single tool call row in an agent transcript: the tool's brand mark, a plain-language verb phrase, quiet metadata or inline decision controls, a status icon, and a collapsible detail panel for Input and Output. Pass calls (or render ToolCallGroup directly) to group every call from one assistant turn under a "Used N tools" header with an overlapping stack of tool marks and total duration.

The component never executes tools or mutates external state. It reports user decisions through onApprove, onDeny, onRetry, or host-registered onAction events, while your application updates each call's status and output.

Usage

Single call

import { ToolCall } from '@uthereal/ui/tool-call'

export function IssueLookup() {
  return (
    <ToolCall
      tool="github"
      title="Searched issues in acme/web"
      titles={{ running: 'Searching issues in acme/web' }}
      status="complete"
      input={{ repo: 'acme/web', query: 'is:open label:release-blocker' }}
      output={{
        kind: 'list',
        items: [
          {
            lead: '#1284',
            title: 'Checkout button stays disabled after coupon removal',
            tag: 'checkout',
          },
          {
            lead: '#1291',
            title: 'Webhook retry posts a second charge after a 504',
            tag: 'billing',
          },
        ],
      }}
      durationMs={1180}
    />
  )
}

Multi-call turn summary

import { ToolCallGroup, type ToolCallItem } from '@uthereal/ui/tool-call'

export function AssistantTurnTools({
  calls,
  working,
  onApprove,
  onDeny,
  onRetry,
}: {
  calls: readonly ToolCallItem[]
  working: boolean
  onApprove: (call: ToolCallItem) => void
  onDeny: (call: ToolCallItem) => void
  onRetry: (call: ToolCallItem) => void
}) {
  return (
    <ToolCallGroup
      calls={calls}
      active={working}
      onApprove={onApprove}
      onDeny={onDeny}
      onRetry={onRetry}
    />
  )
}

Examples

Turn group

Several calls from one assistant turn grouped under "Used N tools" with an overlapping brand mark stack and total duration. Set active while the agent is between calls so the header keeps reading "Using N tools" with a shimmer.

Complete, 2 results, 840ms
GitHub: Searched merged PRs touching checkout. Complete, 2 results, 840ms
Complete, 2 rows, 620ms
PostgreSQL: Queried checkout errors by browser. Complete, 2 rows, 620ms
Complete, INC-418, 410ms
Linear: Created incident ticket INC-418. Complete, INC-418, 410ms
Complete, 4 files, 520ms
GitHub: Loaded diff for PR #4812. Complete, 4 files, 520ms
Running
Slack: Checking #release-notes for deploy timestamps. Running

Approval and retry

Human-in-the-loop permission prompts highlight the row with an accent edge, a reason line, and inline Deny / Allow buttons. Failed calls display the error reason and an inline Retry button; denied and cancelled calls settle with muted phrasing.

Needs approval
Slack: Post a summary to #release. Needs approval
Failed: Statement timed out after 2.0s on full table scan
PostgreSQL: Failed to query Q3 invoices. Failed: Statement timed out after 2.0s on full table scan
Cancelled
Terminal: Cancelled staging migration. Cancelled

Structured outputs

Built-in views for list, table (folding after 5 rows), syntax-tinted json (folding after 10 lines behind "Show N more lines"), and text, each with a copy button.

Complete, 6 rows, 640ms
range
Oct 10–15
groupBy
browser, platform
BrowserPlatformSessionsConversion
SafarimacOS142003.1%
SafariiOS284002.8%
ChromemacOS311004.6%
ChromeWindows298004.5%
FirefoxmacOS64004.4%
EdgeWindows89004.3%
PostgreSQL: Queried conversion by browser and platform. Complete, 6 rows, 640ms
Complete, 6 fields, 420ms
{  "milestone": "v2.8",  "status": "in_progress",  "owner": "release-eng",  "checks": {    "unitTests": "passed",    "e2eCheckout": "passed",    "safariAutofill": "failed"  },  "blockers": [
Linear: Fetched release milestone v2.8. Complete, 6 fields, 420ms
Complete, 1.9s
command
pnpm test tests/checkout

PASS checkout/autofill.spec.ts (4 tests, 1.4s) PASS billing/webhooks.spec.ts (6 tests, 0.4s)

Terminal: Ran checkout smoke suite. Complete, 1.9s

Statuses

Each status pairs a distinct icon shape with explicit label text and live-region announcements rather than relying on color alone.

StatusVisual indicatorRow aside & behavior
runningRotating spinner + shimmerShimmers titles.running; opens standalone row automatically.
completeAnimated drawn checkShows summary (or derived count) and tabular durationMs.
errorDanger alert iconShows message reason line and inline Retry button.
approvalAccent question icon + edgeShows message reason line and inline Deny / Allow buttons.
deniedMuted ban icon + muted titleMarks call as not run and shows quiet denied status text.
cancelledMuted dashed circleMarks call as cancelled and shows quiet cancelled status text.

In group mode (calls or ToolCallGroup), any call entering approval or error automatically opens a closed group so decisions are never hidden. Once every call settles, the group auto-collapses 450ms later unless the reader manually opened or closed the group or any row.

Structured outputs

output.kindLayoutFolding thresholdCopy format
listLead, title, and tag subgridAfter 5 resultsOne formatted line each
tableScrollable semantic <table>After 5 rowsTab-separated rows (TSV)
jsonSyntax-tinted monospaceAfter 10 linesPretty-printed JSON
textWrapped plain textNoneRaw text

Raw string outputs pretty-print as JSON when valid (or highlight using language) inside a scrollable code panel bounded by maxHeight. Supply renderOutput(output, state) to render a custom visualization inside the output well.

API reference

These serializable arguments and defaults come directly from the component schema.

ArgumentType / defaultDescription
toolgithub | linear | postgres | slack | gmail | web | terminal | wrenchDefault: "github"The tool that ran, with a built-in mark: github, linear, postgres, slack, gmail, web, terminal or wrench.
titlestring—The settled verb phrase, e.g. "Searched issues in acme/web". Omit it to show the tool name.
titlesobject—Phrasing per status, e.g. { running: "Searching issues" }; falls back to title.
statusrunning | complete | error | approval | denied | cancelledDefault: "complete"running (busy, opens), complete, error (reason + Retry), approval (Allow/Deny), denied or cancelled.
inputstring | object—Arguments the model passed: an object renders as a mono key-value list; a JSON string pretty-prints. Up to 20,000 characters.
outputstring | ToolCallStructuredOutput—What the tool returned: structured (list, table, json, text) or a raw string, which pretty-prints as JSON when it parses. Up to 100,000 characters.
summarystring—Quiet meta before the duration, e.g. "4 results"; derived from the output when omitted.
messagestring—One line under the title: the error reason, or what allowing the call will do.
durationMsnumber—How long the call took, in milliseconds; shown as 640ms or 1.2s, tabular.
callsToolCallItem[]—Every call from one assistant turn (up to 40, each with id, tool, status, input and output); provided, this row renders as the group header "Used N tools".
activeboolean—The agent is still working between calls, so the group header keeps saying "Using".
approveActionstring—Host-registered action fired when the reader allows a call; collected by collectActions, so a composition rejects it while it is not registered.
denyActionstring—Host-registered action fired when the reader denies a call; collected by collectActions.
retryActionstring—Host-registered action fired when the reader retries a failed call; collected by collectActions.
languagetext | bash | json | ts | tsx | js | python | sql | diff | markdown | yaml | html | css—Language of a raw string output, e.g. sql; omit it for json when the output parses as JSON and text otherwise.
inputLabelstringDefault: "Input"Heading of the input section.
outputLabelstringDefault: "Output"Heading of the output section.
statusLabelsToolCallStatusLabelsDefault: {"running":"Running","complete":"Complete","error":"Failed","approval":"Needs approval","denied":"Denied","cancelled":"Cancelled"}Accessible status text for running, complete, error, approval, denied and cancelled; also announced politely when it changes.
copyablebooleanDefault: trueShow copy buttons on the input and output.
copyInputLabelstringDefault: "Copy input"Name of the input copy button.
copyOutputLabelstringDefault: "Copy output"Name of the output copy button.
collapseOnCompletebooleanDefault: trueClose when the call finishes, unless the reader toggled it. In group mode, fold the list 450ms after every call has finished.
defaultOpenboolean—Initially open. Omit it to open while running. Later edits do not reset an existing instance.
maxHeightintegerDefault: 220Height of the raw input and output code before each scrolls, in pixels, 80 to 2000.
recipestudio | softDefault: "studio"Visual treatment. Both recipes use the same interaction behavior.
themeToolCallTheme—Color mode, accent, and tokens, including the status colors and fontFamilyMono. See Theming.
motionnone | subtle | expressiveDefault: "subtle"Open and close motion. System reduced-motion preferences take precedence.
motionOptionsDisclosureMotionOptions—The open and close transition: a tween (ms) or a spring.
dirltr | rtl—Reading direction. Omit it to inherit the page direction.

ToolCallStatusLabels accepts partial overrides for { running, complete, error, approval, denied, cancelled }. Built-in tool brand marks are github, linear, postgres, slack, gmail, web, terminal, and wrench.

React integration

PropPurpose
open, onOpenChangeControl the open state of the row or group; onOpenChange fires on user toggles and auto-close.
onApprove, onDeny, onRetryHandle inline decision clicks. ToolCallGroup passes the target ToolCallItem.
onAction(action, callId?)Fires registered approveAction, denyAction, or retryAction names (with call.id in groups).
renderOutput(output, state)Render custom content inside the Output well; return undefined to fall back to the built-in view.
renderToolMark(tool, size)Replace a tool's built-in 16px row mark or 12px group stack mark.
renderIcon(name, context)Replace a status icon (status), chevron (indicator), or code block icon (file).
highlightSyntax highlighter function for raw string outputs.
preset, tokensApplication defaults and inline --ui-* token overrides.
ref, className, styleApplied to the root container element.

Keyboard & accessibility

KeyAction
TabMoves across the group header, each row toggle, inline Deny / Allow / Retry buttons, copy buttons, and fold toggles.
Enter, SpaceExpands or collapses the group or row, activates inline decisions, copies input/output, or toggles folded rows.
  • Row toggles sit beneath row content so inline decision buttons remain valid sibling <button> elements rather than nested buttons.
  • Each row toggle announces <Tool>: <Title> <Status, summary, duration> via aria-labelledby, and inline decision buttons use call-specific accessible names (Allow: <title>, Deny: <title>, Retry: <title>).
  • Input renders as a <dl> description list and table outputs render semantic <table> / <th scope="col"> markup. Folded rows receive aria-hidden="true" until expanded.
  • Pre-mounted polite role="status" live regions outside buttons announce status transitions and copy outcomes without shifting button width.
  • Container queries (@container) adapt cleanly below 440px by wrapping reasons, moving decision buttons beneath the reason line, dropping the 38px detail indent, and keeping only duration metadata.

Motion & theming

Row heights follow content changes on the critically damped smooth spring (0.4s, bounce 0) while container width resizes cut immediately. Status icons swap on the snappy spring (0.26s, bounce 0.12) and the success checkmark draws itself once. In group mode, newly joined tool marks widen the overlapping stack on the morph spring (0.42s, bounce 0.16), and opening staggers rows 20ms apart.

Under prefers-reduced-motion: reduce, springs, spinner rotation, stagger, and shimmer travel stop while status and copy transitions crossfade in 120ms. Setting motion="none" makes every transition immediate (0ms).

TokenRole
--ui-surface, --ui-surface-raised, --ui-surface-sunkenRow card background, soft recipe surface, and detail wells.
--ui-border, --ui-border-subtle, --ui-border-strongCard outline, group divider, and hovered action borders.
--ui-text, --ui-text-secondary, --ui-mutedTitles, notes/tags, metadata, and JSON literals.
--ui-accent, --ui-accent-foreground, --ui-focus-ringApproval border/icon, Allow fill, and focus outlines.
--ui-success, --ui-warning, --ui-dangerComplete check, JSON number tint, and error status/meta.
--ui-font, --ui-font-mono, --ui-radius, --ui-radius-smTypography and corner radii.

An application-wide UtherealProvider supplies theme, recipe, and motion defaults.

Composition

In an agent composition, ToolCall is a leaf component. Register approveAction, denyAction, and retryAction on the host so collectActions validates them atomically. See Building with agents.

{
  "type": "ToolCall",
  "props": {
    "tool": "slack",
    "title": "Posted to #release",
    "titles": {
      "approval": "Post a summary to #release"
    },
    "status": "approval",
    "message": "Sends as Release agent to 48 people in #release",
    "approveAction": "approve_tool_call",
    "denyAction": "deny_tool_call"
  },
  "children": []
}

On this page