Tool Call
NewAn agent's function call with live status, arguments, result, timing and an approve or deny step.
Input
{
"email": "synccn@example.com",
"limit": 5
}Output
[
{
"id": "ord_8812",
"total": 129,
"status": "delivered"
}
]Input
{
"order": "ord_8812",
"amount": 129,
"reason": "damaged"
}Installation
$ pnpm dlx shadcn@latest add @synccn/tool-callFirst time in this project? Connect synccn with one command.
Usage
import { ToolCall } from "@/components/ui/tool-call";<ToolCall name="search_docs" status="running" input={{ query }} />API reference
Generated from the component's TypeScript types, so it always matches the code.
ToolCall
A tool or function call made by an agent: name, live status, arguments and result, with an approval step for actions that need a yes first.
- namerequired
stringThe tool's name, e.g. search_docs.
- description
React.ReactNodeWhat it does, in words.
- statusrequired
"pending" | "running" | "success" | "error" | "approval"—
- input
unknownArguments the model passed. Objects are shown as formatted JSON.
- output
unknownWhat the tool returned.
- error
React.ReactNodeWhy it failed, when status is "error".
- duration
numberHow long it took, in milliseconds.
- onApprove
() => voidWith status "approval", shows Approve and Deny.
- onDeny
() => void—
- defaultOpen
booleanDefault
falseOpen at first. Calls waiting for approval or that failed are always open.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Helpers
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
- lucide-react for Check, ChevronDown, CircleDashed, Loader2, ShieldQuestion, Wrench, X
Used by
Keyboard
- EnterorSpaceShow or hide arguments and result
Accessibility
- Status is written as text next to its icon. Calls waiting for approval and failed calls stay open so the choice and the error are never hidden.
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA attributes: aria-controls, aria-expanded
- Includes text only screen readers hear