ToolCall

Card for one AI tool invocation — the tool name, its lifecycle status, collapsible input/output, and approval actions

Category: display · WCAG 2.2-AA · ai, agent, tool, function-call, approval, mcp, status

States

Props

PropTypeDefaultDescription
namestring—The tool’s name, shown in monospace (e.g. `search_web`).
status'pending' | 'running' | 'awaiting-approval' | 'complete' | 'error' | 'denied'—Lifecycle, matching the AI SDK tool-part states: `pending` (input streaming), `running`, `awaiting-approval`, `complete`, `error`, `denied`.
inputReactNode—The call’s arguments. A string (e.g. `JSON.stringify(args, null, 2)`) renders preformatted; any other node renders as given.
outputReactNode—The tool’s result — a string renders preformatted, a node as given.
errorReactNode—Why the call failed. The panel opens itself when status is `error`.
actionsReactNode—Rich slot below the card — typically Approve / Deny buttons while `awaiting-approval`. Always visible, never inside the collapsible panel.
labels{ pending?: string; running?: string; awaitingApproval?: string; complete?: string; error?: string; denied?: string; input?: string; output?: string; errorHeading?: string }—Overrides for the component’s user-visible strings (i18n).

Design tokens

When to use

When not to use

How to build an accessible ToolCall in React →

Examples

Running

<ToolCall name="search_web" status="running" input={'{ "query": "cascivo pricing" }'} />

Complete

<ToolCall
  name="get_weather"
  status="complete"
  input={'{ "city": "Berlin" }'}
  output={'{ "tempC": 18, "sky": "clear" }'}
/>

Awaiting approval

<ToolCall
  name="send_email"
  status="awaiting-approval"
  input={'{ "to": "[email protected]", "subject": "Weekly report" }'}
  actions={
    <>
      <Button variant="ghost" size="sm">Deny</Button>
      <Button size="sm">Approve</Button>
    </>
  }
/>

Error

<ToolCall name="fetch_page" status="error" error="The page returned 404." />

Related components

← Back to docs