Tool

Displays tool call details including input, output, status, and errors. Ideal for visualizing AI tool usage in chat UIs. Compatible with AI SDK v5 architecture.

Examples

Basic Tool

Tool States

Show different states of tool execution: pending, running, completed, and error.

Installation

npx shadcn add "https://prompt-kit.com/c/tool.json"

Component API

Tool

PropTypeDefaultDescription
toolPartToolPartThe tool invocation data to display
defaultOpenbooleanfalseWhether the tool details are expanded by default
classNamestringAdditional CSS classes

ToolPart

PropTypeDefaultDescription
typestringThe type of the tool
statestringThe state of the tool
inputRecord<string, unknown>The input data to the tool
outputRecord<string, unknown>The output data from the tool
toolCallIdstringThe tool call identifier
errorTextstringThe error text if the tool failed to execute