Tool Result

Shows what a tool call returned: a header with the tool, title and a running, success, error or cancelled status, a capped log that tracks terminal output or a highlighted response body, retry and copy actions, and a short summary once done.

Terminal Output

tool-result.tsx

Command output scrolls into a fixed-height log that keeps the newest line visible, then folds into a one-line summary of the finished run.

Tool Result Terminal Output preview width

Request Result

tool-result.tsx

An HTTP call in flight that resolves into a syntax-colored response body you can copy, or retry if it fails.

Tool Result Request Result preview width

API Reference

ToolResultOutput

language?
"text" | "bash" | "diff" | "json" | "tsx" | "typescript"
bash
className?
string
—

ToolResult

tool
ReactNode
—
title
ReactNode
—
status?
"success" | "error" | "running" | "cancelled"
running
kind?
"custom" | "terminal" | "request"
custom
meta?
ReactNode
—
icon?
ReactNode
—
open?
boolean
—
defaultOpen?
boolean
true
onOpenChange?
((open: boolean) => void)
—
collapseOnComplete?
boolean
true
maxHeight?
number
220
copyText?
string
—
onCopy?
(() => void | Promise<void>)
—
onRetry?
(() => void)
—
className?
string
—
contentClassName?
string
—

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/tool-result
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

Composition

Feed the output primitive whatever the tool produced: shell text, request details, code or other structured data.

ToolResult
└── ToolResultOutput

Note: Tool Approval asks permission before anything runs. Code Block highlights code that a tool hands back. Agent Activity logs the call as one step in a longer run.

How it works

Treat a tool result as a receipt from something that ran, not as one more chat message. A short summary sits on top; the output underneath is there for anyone who needs to check, retry or reuse it.

Updated