Tool result
The outcome of a tool call, collapsed to a summary and expandable to detail.
> caliper@0.4.0 test> vitest run
✓ src/counter.test.tsx (4 tests) 38ms ✓ src/table.test.tsx (12 tests) 91ms ✓ src/tree.test.tsx (9 tests) 64ms ✗ src/thread.test.tsx (6 tests | 1 failed) 120ms → expected "Not sent" but received "Sending…"
Test Files 1 failed | 3 passed (4) Tests 1 failed | 30 passed (31) Duration 1.02sWhen to use
- An agent calls tools and the user may want to inspect the output.
- You want success and failure to read at a glance.
When not to use
- The output is the answer itself; show it as a message.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/tool-result
Adds its 7 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
ToolResult
9 props
PropTypeDefaultDescription
name *string—
summarystring—One line shown while collapsed, such as "12 files matched".
kindToolResultKind"text"
outputunknown—A string for text and error, any JSON value for json, rows for table.
columnsreadonly string[]—Column headings for table output; each row is an object or an array.
durationstring—
defaultOpenbooleanfalse
childrenReactNode—Replaces the body for kind "custom".
classNamestring—
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It is built on native elements and keeps aria-label, aria-expanded, aria-controls and aria-hidden in step with state.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/tool-result.mdThe index of every part is at /llms.txt.