Tool Calls
The list of what an agent does, one line per step. Reads fold into a summary, edits and errors stay in view, and approvals ask before a tool runs.
- Category
- AI
- Components used
- 8
- Files
- 9
- Usage examples
- 3
- Access
- HextaUI Pro (55 blocks)
- Source updated
- Counted in
- UI component usage study
Part of HextaUI Pro, all 55 blocks, $79 one-time, Compare plans
Agents can take dozens of small steps before they answer. Showing every one buries the answer, and hiding them makes the agent feel like a black box. Tool Calls gives each step one quiet line that reads like a sentence, such as “Read components/search.tsx” or “Searched for useResults, 3 results”.
Reads, searches and lookups that run back to back fold into a single summary like “Explored 6 files”. Anything that changes something, needs a decision or fails stays on its own line, with a live timer while it runs. Open any step to see the real work: the file, the diff, the terminal or the results.
Every AI SDK tool state has its own look and wording, including approvals. Approving offers Allow, Deny, Always allow and “Tell it what to do instead”, which sends your words back as the reason, with ⌘↵ and ⌘⌫ from the keyboard. getToolPartStatus maps tool parts for you, and ready-made views cover search results, file lists, multiple-choice questions and raw JSON.
Get HextaUI Pro
One payment unlocks every block, including future ones. See pricing.
Add the Pro registry to components.json
components.json Add your token
Create a token on your account page and put it in
.env.localasHEXTAUI_PRO_TOKEN.Add the block
pnpm dlx shadcn@latest add @hextaui-pro/tool-calls
With the AI SDK
Turn tool parts into steps with getToolPartStatus and pick a kind and view per tool. Pass stopped once the chat stops streaming, so a call cut off midway reads Cancelled instead of spinning forever.
Approving commands
Mark a tool with needsApproval on the server and answer with addToolApprovalResponse. Always allow remembers the program, and a denial can carry what to do instead as its reason. ⌘↵ and ⌘⌫ work while the step has focus.
Asking the user
A client tool with no execute function waits for an answer. Show the choices with AskUser and send the pick back with addToolOutput.
Anatomy
The parts you compose, from the outside in.
| Part | Description |
|---|---|
ToolCalls | The list. Groups quiet runs and shares timing between steps. |
ToolCall | One step: icon, sentence, meta, timer, and its content when opened. |
ToolGroup | A folded run of quiet steps with a summary line. |
ToolApproval | The approve, deny and redirect card, shown inside a step waiting for approval. |
SearchResults, FileList, AskUser, ToolJson | Views to pass as a step’s content. |
ToolCalls
Also accepts every ol prop except children.
| Prop | Type | Default |
|---|---|---|
callsSteps in the order they ran. | ToolCallProps[] | – |
groupFold runs of quiet steps. Set false to show every step. | boolean | true |
| Prop | Type | Default |
|---|---|---|
idStable id, usually the toolCallId. Timing is kept per id. | string | – |
statusstreaming, running, waiting, approval, done, error, denied or cancelled. | ToolStatus | – |
kindread, search, list, edit, write, run, web, fetch, ask or other. Picks the icon and verb. | ToolKind | "other" |
subjectWhat it acted on: a path, query, URL or command. | string | – |
nameTool name, used for the sentence when kind is other. | string | – |
titleReplaces the generated sentence entirely. | string | – |
metaShort result after the sentence, such as “3 results” or “+12 −3”. | ReactNode | – |
contentShown when the step is opened. | ReactNode | – |
exitCodeFor run steps. Non-zero marks the step failed and opens it. | number | – |
errorMessage shown for the error status. | string | – |
durationStored duration in seconds, for history. | number | – |
approvalReason, outcome and always-allow label for approvals. | ToolCallApproval | – |
defaultOpenOverride whether the step starts open. | boolean | – |
onApproveCalled from Allow or Always allow. | (options: { always: boolean }) => void | – |
onDenyCalled from Deny, or with text from “Tell it what to do instead”. | (reason?: string) => void | – |
| Prop | Type | Default |
|---|---|---|
reasonWhy approval is needed, shown above the buttons. | string | – |
approvedThe answer, once given. | boolean | – |
automaticApproved by a rule, so no card is shown. | boolean | – |
denialReasonWhat the person asked for instead, shown on denied steps. | string | – |
alwaysLabelShows “Always allow …” with this label, for example the program name. | string | – |
getToolPartStatus(part, options)
Maps an AI SDK tool part to a ToolStatus.
| Prop | Type | Default |
|---|---|---|
partThe part from message.parts. | ToolUIPart | DynamicToolUIPart | – |
options.stoppedThe chat stopped, so unfinished calls read Cancelled instead of spinning. | boolean | false |
options.waitingA client tool is waiting for the person, for example AskUser. | boolean | false |
| Prop | Type | Default |
|---|---|---|
questionThe question. | string | – |
optionsThe choices. | { value, label, description? }[] | – |
answerThe chosen value, once answered. | string | – |
onAnswerSend it back with addToolOutput. | (value: string) => void | – |
| Prop | Type | Default |
|---|---|---|
queryHighlighted inside each match. | string | – |
matchesThe matches. | { path, line, text }[] | – |
limitShown before “Show all”. | number | 6 |
| Key | Action |
|---|---|
| EnterSpace | Opens or closes a step or a folded group. |
| ⌘↵ | Allows a step waiting for approval while focus is inside it. |
| ⌘⌫ | Denies a step waiting for approval while focus is inside it. |
| Esc | Leaves “Tell it what to do instead” without sending. |
- Steps are an ordered list, so screen readers announce how many steps there are and where each one sits.
- Steps that need the person are announced through a polite live region, such as “Approval needed: Run pnpm test”, along with questions and errors. Routine steps stay quiet so screen readers aren’t flooded.
- Status is never color alone: each state has its own icon and wording.
- Approval shortcuts are ignored while typing in a field, and the redirect field focuses itself when opened and returns focus when closed.
Built with
The free HextaUI components Tool Calls is made from. Each one installs on its own.
Code
9 files, added to components/blocks/tool-calls.