Tool Calls Section
gaia/tool-calls-sectionFreeComponent
An expandable section showing AI agent tool usage with icons, inputs, and outputs.
Install it
npx shadcn@latest add https://ui.heygaia.io/r/tool-calls-section.jsonSource
1"use client";23import type { ReactNode } from "react";4import { useMemo, useState } from "react";56import { HugeiconsIcon, ArrowDown01Icon, ToolsIcon } from "@/components/icons";7import { cn } from "@/lib/utils";8import { formatToolName, getToolCategoryIcon } from "@/lib/utils/tool-icons";9import { CompactMarkdown } from "@/registry/new-york/ui/compact-markdown";1011// ============================================================================12// Types13// ============================================================================1415export interface ToolCallEntry {16 /** Name of the tool that was called */17 tool_name: string;18 /** Category/integration the tool belongs to (e.g., "gmail", "search", "memory") */19 tool_category: string;20 /** Human-readable message describing what the tool did */21 message?: string;22 /** Whether to show the category label (default: true) */23 show_category?: boolean;24 /** Unique ID for this tool call */25 tool_call_id?: string;26 /** Input parameters passed to the tool */27 inputs?: Record<string, unknown>;28 /** Output/result from the tool */29 output?: string;30 /** URL to custom icon for integrations */31 icon_url?: string;32 /** Friendly name for the integration (e.g., "Linear", "Slack") */33 integration_name?: string;34}3536export interface IntegrationInfo {37 iconUrl?: string;38 name?: string;39}4041export interface ToolCallsSectionProps {42 /** Array of tool call entries to display */43 toolCalls: ToolCallEntry[];44 /** Optional map of integration IDs to their info for icon/name lookup */45 integrations?: Map<string, IntegrationInfo>;46 /** Maximum number of icons to show in the stacked display (default: 10) */47 maxIconsToShow?: number;48 /** Whether to start with the accordion expanded (default: false) */49 defaultExpanded?: boolean;50 /** Custom class name for the container */51 className?: string;52 /** Custom icon size (default: 21) */53 iconSize?: number;54 /** Custom icon renderer override */55 renderIcon?: (call: ToolCallEntry, size: number) => ReactNode;56 /** Custom content renderer override for inputs/outputs */57 renderContent?: (content: unknown) => ReactNode;58}5960// ============================================================================61// Helper Components62// ============================================================================6364interface ChevronIconProps {65 isExpanded: boolean;66 size?: number;67 className?: string;68}6970function ChevronIcon({ isExpanded, size = 18, className = "" }: ChevronIconProps) {71 return (72 <HugeiconsIcon73// … truncated
What it pulls in
Other registry items
Files it writes
More from gaia
All 26 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Area Chartarea-chart | gaia | Components | Free | 1 dep | |
| Author Tooltipauthor-tooltip | gaia | Components | Free | no deps | |
| Bar Chartbar-chart | gaia | Components | Free | 1 dep | |
| Composercomposer | gaia | Components | Free | no deps | |
| Email Compose Cardemail-compose-card | gaia | Components | Free | no deps | |
| Gauge Chartgauge-chart | gaia | Components | Free | 1 dep | |
| GitHub Stars Buttongithub-stars-button | gaia | Components | Free | 1 dep | |
| Holo Cardholo-card | gaia | Components | Free | 1 dep · 2 files |
