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
Prop | Type | Default | Description |
---|---|---|---|
toolPart | ToolPart | The tool invocation data to display | |
defaultOpen | boolean | false | Whether the tool details are expanded by default |
className | string | Additional CSS classes |
ToolPart
Prop | Type | Default | Description |
---|---|---|---|
type | string | The type of the tool | |
state | string | The state of the tool | |
input | Record<string, unknown> | The input data to the tool | |
output | Record<string, unknown> | The output data from the tool | |
toolCallId | string | The tool call identifier | |
errorText | string | The error text if the tool failed to execute |