Skip to content
synccn

Tool Call

New

An agent's function call with live status, arguments, result, timing and an approve or deny step.

Input

{
  "email": "synccn@example.com",
  "limit": 5
}

Output

[
  {
    "id": "ord_8812",
    "total": 129,
    "status": "delivered"
  }
]

Input

{
  "order": "ord_8812",
  "amount": 129,
  "reason": "damaged"
}
The assistant wants to run this.

Installation

$ pnpm dlx shadcn@latest add @synccn/tool-call

First time in this project? Connect synccn with one command.

Usage

import { ToolCall } from "@/components/ui/tool-call";<ToolCall name="search_docs" status="running" input={{ query }} />

API reference

Generated from the component's TypeScript types, so it always matches the code.

ToolCall

A tool or function call made by an agent: name, live status, arguments and result, with an approval step for actions that need a yes first.

  • namerequired
    string

    The tool's name, e.g. search_docs.

  • description
    React.ReactNode

    What it does, in words.

  • statusrequired
    "pending" | "running" | "success" | "error" | "approval"

    —

  • input
    unknown

    Arguments the model passed. Objects are shown as formatted JSON.

  • output
    unknown

    What the tool returned.

  • error
    React.ReactNode

    Why it failed, when status is "error".

  • duration
    number

    How long it took, in milliseconds.

  • onApprove
    () => void

    With status "approval", shows Approve and Deny.

  • onDeny
    () => void

    —

  • defaultOpen
    boolean

    Default false

    Open at first. Calls waiting for approval or that failed are always open.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

npm packages

Keyboard

  • EnterorSpaceShow or hide arguments and result

Accessibility

  • Status is written as text next to its icon. Calls waiting for approval and failed calls stay open so the choice and the error are never hidden.

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA attributes: aria-controls, aria-expanded
  • Includes text only screen readers hear