Skip to content
Look

Shared with the landing page. Theme is the select beside this menu.

ToolCall

Open .md
Live preview

Loading example…

Collapsible tool invocation with status, JSON arguments and JSON result.

import { ToolCall } from "@jcsoftdev/ui/ai";

Single-component entry points tree-shake to just this component: @jcsoftdev/ui/ai/tool-call.

<ToolCall
name="buscar_turnos"
status="done"
duration="1,2 s"
defaultOpen
args={{ fecha: "2026-06-20", barbero: "Diego Quispe" }}
result={{ libres: ["10:00", "11:30", "16:00"], total: 3 }}
/>
Prop Type Default Description
name * string Tool identifier, e.g. buscar_turnos.
status "done" | "error" | "pending" | "running" "pending"
args unknown Arguments sent to the tool; shown as formatted JSON.
result unknown Result returned by the tool; shown as formatted JSON.
error string Error text when status is error.
duration string Pre-formatted duration, e.g. 1,2 s.
defaultOpen boolean false
className string
classNames Partial<Record<ToolCallPart, string>> Per-part classes merged with cn; consumer classes win. className still targets the root and is merged last.
intent string
intentKey string

* marks a required prop.

packages/ui/src/ai/tool-call/tool-call.tsx