Back to Components

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

PropTypeDefaultDescription
toolstringTool name shown next to the label.
labelstring'Result'Header eyebrow.
status'success' | 'error''success'error tints the border and header.
durationstringRight-aligned timing.
textstringPlain monospace payload; scrolls past ~320px.
collapsiblebooleanfalseDisclosure header.
openboolean (bindable)trueDisclosure state.
childrenSnippetRich payload — wins over text.

Install

CLI

npx @a3tai/mittsu add tool-result-card