Skip to content
Browse docs and components

Tool Result

tool-result

One agent tool call and its output: a Trace line that summarises what ran and how it went, over output that follows a running call and folds away when it finishes, with copy and run again.

Responsive

Install

$npxshadcnadd@forme/tool-result

Adds the component, its registry dependencies, and the token stylesheet you import once.

Examples

2 more ways to put it to work. Install one by name and it lands beside the component, or copy it from the Code tab into your app.

Failed, then retried

A request that times out shows its error and status, and Run again makes a second call that succeeds.

$npxshadcnadd@forme/tool-result-retry
Responsive

Custom result

A custom kind with its own icon and children: the documents a docs search returned, as links.

$npxshadcnadd@forme/tool-result-search-results
Responsive

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

ToolResult

One tool call and what came back.

PropTypeDefaultDescription
tool*ReactNode—The tool's name, in mono: bash, fetch, search_docs.
title*ReactNode—What it did, in words: "Ran the test suite".
status'running' | 'error' | 'success' | 'cancelled'"running"
kind"terminal" | "request" | "custom""custom"terminal and request draw their own icon; pass icon for anything else.
iconReactNode—
metaReactNode—Quiet text after the title: "1.2s", "200 OK".
childrenReactNode—The output. ToolOutput for text, or anything else.
defaultOpenbooleantrue
collapseOnCompletebooleantrueFolds the output away when the call finishes, leaving the header as a summary.
maxHeightnumber240The tallest the output gets before it scrolls, in pixels.
copyTextstring—Text for the copy button. No button without it.
onRetry() => void—Shows "Run again" once the call has finished.
classNamestring—

ToolOutput

Text a tool printed: mono, wrapped rather than scrolled sideways.

PropTypeDefaultDescription
children*string—
language'html' | 'text' | 'ts' | 'tsx' | 'js' | 'jsx' | 'json' | 'css' | 'bash'"text"Highlights the output; plain text by default.
classNamestring—