This page as markdown: /tool-call.md · Index for agents: /llms.txt · Everything in one file: /llms-full.txt

ToolCall

Status: stable

One tool an agent called, as a quiet row inside its turn: a status glyph, what it did, the tool's name and where it is — with the arguments and result behind a disclosure.

Keywords: tool call, function call, tool use, agent step, mcp, ai, tool result, agent activity

Usage

Use it for each tool call in an assistant's turn, so the person can see what the agent did and check any step. The row is the summary — glyph, a plain-words title, the tool's name, the status — and stays one line, so a turn with ten calls is still scannable. Input and output sit behind the disclosure, because they are read rarely and, when they are, in full.

Best practices

Anatomy

Part Required Description
Status glyph yes Spinner while running, then the outcome: check, warning, clock (awaiting approval) or ×. The only part that moves.
Title no What the call does, in plain words. Without one, the tool's name leads.
Name yes The tool's own name in mono, after the title. Hidden below the sm breakpoint when a title is present.
Status yes One word for where the call is: Running, Needs approval, Done, Failed, Denied.
Error line no The failure message, under the row and always visible.
Details no Input and output as code, or a rendered result. A disclosure; the row is its trigger.

Props

Name Type Default Description
name string — The tool's own name, as the model called it (search_docs). Shown in mono.
title ReactNode — What the call does, in words a person reads. Leads the row; omit it and name leads.
status "running" | "awaiting" | "complete" | "error" | "denied" "running" Where the call is. awaiting is held for the person's approval; denied is one they declined.
statusLabel string — Overrides the status word, for another language or a more specific phrase.
input unknown — The arguments. A string shows as is; anything else as formatted JSON.
output unknown — The result, shown the same way as input.
error ReactNode — What went wrong, for status="error". Always visible under the row.
children ReactNode — A rendered result in place of output's code view.
defaultOpen boolean false Open the details on mount.
open boolean — Controlled open state of the details.
onOpenChange (open: boolean) => void — Called when the details open or close.

Variants

Tokens used

card, border, destructive, muted, muted-foreground, foreground, tone-warning, ring

Motion

Accessibility

Related

Examples

A finished call

import { ToolCall } from "@sableui/react"

<ToolCall
	name="search_docs"
	title="Searched the docs"
	status="complete"
	input={{ query: "date range picker" }}
	output={{ hits: ["DatePicker", "Calendar", "DateTile"] }}
/>

Running, then failed

import { ToolCall } from "@sableui/react"

<div className="flex flex-col gap-2">
	<ToolCall name="read_file" title="Reading package.json" status="running" input={{ path: "package.json" }} />
	<ToolCall
		name="run_tests"
		title="Ran the tests"
		status="error"
		error="3 of 412 tests failed in date-picker.test.tsx."
		input={{ filter: "date-picker" }}
	/>
</div>

Waiting for approval

import { ToolCall } from "@sableui/react"

<ToolCall name="send_email" title="Send the invoice to Ada" status="awaiting" input={{ to: "ada@example.com", subject: "INV-1042" }} />