Skip to content
uifiles
Browse components
AgentComponent

Tool

Collapsible tool-call card for AI chat: header with wrench icon, tool name derived from the part type (or toolName for dynamic tools), and a status badge for every AI SDK tool state (input-streaming, input-available, approval-requested, approval-responded, output-available, output-denied, output-error); expandable content showing Parameters (input as JSON) and Result or Error (JSON and strings in Code Blocks, React nodes and primitives rendered as given). Use it to render ToolUIPart and DynamicToolUIPart parts from useChat messages.

pnpm dlx shadcn@latest add @uifiles/tool

Waiting for input

input-streaming: nothing has arrived yet, so the input area shows a placeholder.

Parameters

No input yet

Input streaming

input-streaming: the arguments so far, updated as they stream.

Input complete

input-available: the call is ready and has not returned yet.

Output available

output-available: input and the result, both as formatted JSON.

Parameters
{  "city": "Melbourne",  "unit": "celsius"}
Result
{  "city": "Melbourne",  "temperature": 18,  "unit": "celsius",  "conditions": "Partly cloudy",  "humidity": 62}

Output error

output-error: the error text in place of a result.

Parameters
{  "city": "Melbourne",  "unit": "celsius"}
Error
Upstream weather service returned 503 Service Unavailable

Dynamic tool, custom title

approval-requested: a dynamic-tool part named by its toolName and a title of its own.