AI
ToolResultCard
The richer sibling to ToolCallCard: where that renders a call as a quiet row, this gives the returned payload its own bordered, scrollable surface.
Examples
Plain output
Result run_tests 4.2s
47 passed, 0 failed coverage 91.3% (+0.4%) duration 4.2s
<ToolResultCard tool="run_tests" duration="4.2s" text={`47 passed, 0 failed
coverage 91.3% (+0.4%)`} />Error
Failed run_tests
FAIL src/Button.test.tsx
● renders the ghost variant
Snapshot does not match: 2 differences<ToolResultCard tool="run_tests" status="error" text="2 snapshot failures…" />Beneath a call, with rich content
Collapsible, carrying a DiffView instead of plain text.
edit_file src/config.ts +1 −1
+1 −1
const timeout = 5000;
Removed const retries = 1;
Added const retries = 3;
<ToolCallCard calls={call} />
<ToolResultCard collapsible tool="src/config.ts">
<DiffView lines={diff} lineNumbers={false} />
</ToolResultCard>Props
| Prop | Type | Default | Description |
|---|---|---|---|
tool | string | — | Tool name shown next to the label. |
label | string | 'Result' | Header eyebrow. |
status | 'success' | 'error' | 'success' | error tints the border and header. |
duration | string | — | Right-aligned timing. |
text | string | — | Plain monospace payload; scrolls past ~320px. |
collapsible | boolean | false | Disclosure header. |
open | boolean (bindable) | true | Disclosure state. |
children | Snippet | — | Rich payload — wins over text. |
Install
CLI
npx @a3tai/mittsu add tool-result-card