--- name: tools-ui description: | Tool lifecycle UI components for React/Next.js from ui.inference.sh. Display tool calls: pending, progress, approval required, results. Capabilities: tool status, progress indicators, approval flows, results display. Use for: showing agent tool calls, human-in-the-loop approvals, tool output. Triggers: tool ui, tool calls, tool status, tool approval, tool results, agent tools, mcp tools ui, function calling ui, tool lifecycle, tool pending --- # Tool UI Components Tool lifecycle components from [ui.inference.sh](https://ui.inference.sh). ## Quick Start ```bash npx shadcn@latest add https://ui.inference.sh/r/tools.json ``` ## Tool States | State | Description | |-------|-------------| | `pending` | Tool call requested, waiting to execute | | `running` | Tool is currently executing | | `approval` | Requires human approval before execution | | `success` | Tool completed successfully | | `error` | Tool execution failed | ## Components ### Tool Call Display ```tsx import { ToolCall } from "@/registry/blocks/tools/tool-call" ``` ### Tool Result ```tsx import { ToolResult } from "@/registry/blocks/tools/tool-result" ``` ### Tool Approval ```tsx import { ToolApproval } from "@/registry/blocks/tools/tool-approval" executeTool()} onDeny={() => cancelTool()} /> ``` ## Full Example ```tsx import { ToolCall, ToolResult, ToolApproval } from "@/registry/blocks/tools" function ToolDisplay({ tool }) { if (tool.status === 'approval') { return ( ) } if (tool.result) { return ( ) } return ( ) } ``` ## Styling Tool Cards ```tsx ``` ## Tool Icons Tools automatically get icons based on their name: | Pattern | Icon | |---------|------| | `search*`, `find*` | Search | | `read*`, `get*` | File | | `write*`, `create*` | Pencil | | `delete*`, `remove*` | Trash | | `send*`, `email*` | Mail | | Default | Wrench | ## With Agent Component The Agent component handles tool lifecycle automatically: ```tsx import { Agent } from "@/registry/blocks/agent/agent" ``` ## Related Skills ```bash # Full agent component (recommended) npx skills add inference-sh/skills@agent-ui # Chat UI blocks npx skills add inference-sh/skills@chat-ui # Widgets for tool results npx skills add inference-sh/skills@widgets-ui ``` Docs: [ui.inference.sh/blocks/tools](https://ui.inference.sh/blocks/tools)