Cameron Kelliher

AI Tool Call

AI chats 45

About

Compound component for displaying AI tool and function invocations with status badges, JSON input/output, and a collapsible interface for MCP and function-calling workflows.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds AI Tool Call to your project and fits it to your theme.

Code

How AI Tool Call is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import {
  AiToolCall,
  AiToolCallHeader,
  AiToolCallContent,
  AiToolCallInput,
  AiToolCallOutput,
  AiToolCallError,
} from "@/components/ui/tool-call";

export default function Default() {
  return (
    <div className="mx-auto w-full max-w-md space-y-3 p-6">
      <AiToolCall name="search_web" state="completed">
        <AiToolCallHeader />
        <AiToolCallContent>
          <AiToolCallInput input={{ query: "React best practices 2025" }} />
          <AiToolCallOutput>
            Found 5 relevant articles about React best practices.
          </AiToolCallOutput>
        </AiToolCallContent>
      </AiToolCall>

      <AiToolCall name="create_file" state="running">
        <AiToolCallHeader />
      </AiToolCall>

      <AiToolCall name="delete_database" state="awaiting-approval">
        <AiToolCallHeader />
      </AiToolCall>

      <AiToolCall name="api_request" state="error">
        <AiToolCallHeader />
        <AiToolCallContent>
          <AiToolCallInput input={{ url: "https://api.example.com/data" }} />
          <AiToolCallError error="Connection timeout after 30s" />
        </AiToolCallContent>
      </AiToolCall>
    </div>
  );
}

Dependencies

More by Cameron Kelliher

View all
  • AI Chain of Thought

    AI Chain of Thought

    110
  • Helix Loader

    Helix Loader

    94
  • AI Streaming Text

    AI Streaming Text

    49
  • Signal Bars Loader

    Signal Bars Loader

    41
  • Glitch Text Loader

    Glitch Text Loader

    41
  • AI Prompt Diff

    AI Prompt Diff

    38
  • AI Routing Indicator

    AI Routing Indicator

    33
  • AI Conversation Tree

    AI Conversation Tree

    32

More in AI chats

View all
  • AI Actions

    AI Actions

    318
  • Color Picker

    Color Picker

    77
  • Agent Chat

    Agent Chat

    17
  • Approval Card

    Approval Card

    13
  • System Message

    System Message

    53
  • Prompt with Model Picker

    Prompt with Model Picker

    2
  • Message

    Message

    48
  • AI Task List

    AI Task List

    159