ToolCall
ToolCall
Section titled “ToolCall”Category: Chat
<ChatMessage role="assistant" name="helix-ui" footer={ <ToolCall name="web_search" summary={`{ q: "design tokens DTCG" }`} status="done" defaultOpen input={<CodeBlock language="json" code={`{ "q": "design tokens DTCG", "limit": 5 }`} />} output={ <CodeBlock language="json" code={`[{ "title": "DTCG community group", "url": "..." }, …]`} /> } /> }> Found 5 results — the most relevant is the W3C DTCG draft.</ChatMessage>Install: @helix-ui/core
import { ToolCall } from '@helix-ui/core';status: stable · since: 0.3.0
Tags: ai, function-call, collapsible, tool
Anatomy
Section titled “Anatomy”[ ▶ get_weather running ][ ▼ get_weather ok ] input: { city: "Seoul" } output: { temp: 17 }Layout
Section titled “Layout”- display —
block - width —
fill - height —
content - intrinsicSize —
fills width, hugs content - stackable —
true - fullBleed —
false
Visual
Section titled “Visual”A collapsible card showing a tool name, status pill (running / ok / error), an optional one-line summary, and expandable input/output sections rendered as code.
| Name | Type | Default | Description |
|---|---|---|---|
name |
ReactNode |
— | Tool name (e.g. web_search). Required. |
status |
'running' | 'done' | 'failed' |
done |
Current state. running shows a pulsing dot. |
summary |
ReactNode |
— | One-line argument summary, shown next to the name when collapsed (e.g. the JSON args, single-line). |
defaultOpen |
boolean |
false |
Initially expanded. |
open |
boolean |
— | Controlled open. |
onOpenChange |
(open) => void |
— | Open change handler. |
input |
ReactNode |
— | Slot for input args — typically <CodeBlock language="json" />. |
output |
ReactNode |
— | Slot for the result — text, table, or another CodeBlock. |
- children — extra body content rendered after
output
Tokens used
Section titled “Tokens used”color.bg.surface.default, color.bg.surface.subtle, color.bg.action.brand.subtle, color.bg.action.success.subtle, color.bg.action.danger.subtle, color.border.default, color.border.focus, color.text.primary, color.text.secondary, color.text.muted, color.text.action.brand, color.text.action.success, color.text.action.danger, radius.md, radius.full, space.2, space.3, font.family.sans, font.family.mono, font.size.xs, font.size.sm, font.weight.medium, font.weight.semibold
Accessibility
Section titled “Accessibility”Notes
- The header button has
aria-expandedreflecting the disclosure state. - Use inside a ChatMessage’s
footerslot to attach tool calls to a specific assistant turn.
Composes with
Section titled “Composes with”| Component | Relation | Note |
|---|---|---|
ChatMessage |
child |
Inside an assistant message. |
CodeBlock |
child |
Input/output rendered as CodeBlocks. |
ThinkingBlock |
sibling |
Often interleaved with reasoning. |
Prompt examples
Section titled “Prompt examples”These are the AI prompt → JSX mappings used by the helix-ui prompt DSL and integrations like Cursor / Claude Code.
render a tool invocation
Section titled “render a tool invocation”“show a get_weather tool call result”
<ToolCall name="get_weather" status="done" summary="get_weather({ city: 'Seoul' })" input={JSON.stringify({ city: 'Seoul' }, null, 2)} output={JSON.stringify({ temp: 17, condition: 'cloudy' }, null, 2)}/>