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.
Input
location: San Francisco, CA
units: celsius
Output
{
"temperature": 18,
"conditions": "Partly cloudy",
"humidity": 65,
"wind_speed": 12
}Call ID: call_weather_123
Installation
Examples
Tool States
Processing - Input Streaming
Input
file_path: /src/components/Button.tsx
analysis_type: security
Processing tool call...
Call ID: call_stream_001
Ready - Input Available
Input
prompt: A serene mountain landscape at sunset
size: 1024x1024
style: photorealistic
Call ID: call_ready_002
Completed - Output Available
Input
location: Tokyo, Japan
units: celsius
Output
{
"temperature": 22,
"conditions": "Clear sky",
"humidity": 58,
"wind_speed": 8,
"forecast": "Sunny throughout the day"
}Call ID: call_success_003
Error - Output Error
Input
to: user@example.com
subject: Welcome to our platform
body: Thank you for signing up!
Error
SMTP Authentication failed: Invalid credentials for mail.example.com:587. Please check your email configuration.
Call ID: call_error_004
Tool States Compact
Input
query: AI best practices
max_results: 10
Processing tool call...
Call ID: call_001
Input
text: Hello, world!
target_language: es
Call ID: call_002
Input
numbers: [
10,
20,
30,
40
]
Output
{
"result": 100,
"operation": "sum"
}Call ID: call_003
Input
url: https://api.example.com/data
method: GET
Error
Network timeout: Request exceeded 30 second limit
Call ID: call_004
Props
Tool
| Name | Type | Default |
|---|---|---|
toolPart | ToolPart | |
defaultOpen | boolean | false |
open | boolean | |
class | string | |
children | Snippet | |
Tool Composed
| Name | Type | Default |
|---|---|---|
toolPart | ToolPart | |
defaultOpen | boolean | false |
class | string | |
Tool Header
| Name | Type | Default |
|---|---|---|
class | string | |
Tool Content
| Name | Type | Default |
|---|---|---|
class | string | |
children | Snippet | |
Tool Details
| Name | Type | Default |
|---|---|---|
class | string | |
Tool Badge
| Name | Type | Default |
|---|---|---|
state | ToolState | |
class | string | |
Tool Part
| Name | Type | Default |
|---|---|---|
type | string | |
state | ToolState | |
input | Record<string, unknown> | |
output | Record<string, unknown> | |
toolCallId | string | |
errorText | string | |
Tool State
| Name | Type | Default |
|---|---|---|
ToolState | type | type ToolState =
| "input-streaming" // Tool is receiving input
| "input-available" // Tool has input and is ready to execute
| "output-available" // Tool has successfully executed
| "output-error"; // Tool execution failed |