Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Conversation

  • Conversation
  • ChatMessage
  • PromptInput
  • TypingDots

Reasoning and Tools

  • ThinkingBlock
  • ToolCall
  • AgentPlan
  • Dossier
  • Artifact
  • ConfirmCard
  • ThreadList
  • TaskRunner

Assistance

  • StreamingText
  • PromptSuggestions
  • MessageActions
  • Citation

ToolCall

tool-call

Shows an agent tool invocation, arguments, progress, result, and failure state.

Usage

Basic usage

Tool name + status point, expand to see parameters and results.

Input

json
{ "query": "Hulian Design System" }

Output

Found 3 related results, summarized.
tsx
<ToolCall
  name="search_web"
  status="success"
  defaultOpen
  input={<CodeBlock lang="json" code={'{ "query": "Hulian Design System" }'} />}
  output="Found 3 related results, combined."
/>

Running

running is displayed, the status will display Spinner.

tsx
<ToolCall name="run_code" status="running" />

Failure status

error The status point turns red, expand it to see the error details.

Output

Timeout: 30s No response.
tsx
<ToolCall
  name="fetch_url"
  status="error"
  defaultOpen
  output="Timeout: 30s No response."
/>

Waiting

pending means it has been queued but not yet executed.

tsx
<ToolCall name="send_email" status="pending" />

When to Use

Use it to present one agent tool invocation with its name, status, and collapsible input and result. Use AgentPlan for multi-step orchestration and ThinkingBlock for free-form reasoning. ToolCall focuses on one tool's inputs and outputs.

Import

ts
import { ToolCall } from "@hulianui/ui"

Props

NameTypeDefaultDescription
status"pending" | "running" | "success" | "error""success"Status label: "\u7b49\u5f85" (Waiting), "\u8fd0\u884c\u4e2d" (Running), "\u5b8c\u6210" (Complete), or "\u5931\u8d25" (Failed)
defaultOpenboolean-Uncontrolled initial expansion state
openboolean-Controlled expansion state
classNamestring-Container class name

Events

EventTypeDescription
onOpenChange(open: boolean) => voidExpanded state change callback

Slots

SlotTypeDescription
name *ReactNodeTool name rendered in monospace, such as search_web
iconReactNodeTool icon slot (default Wrench)
inputReactNodeInput shown below the built-in Input heading; typically <CodeBlock/> or JSON text
outputReactNodeResult shown below the built-in Output heading; typically <CodeBlock/>, <Prose/>, or text
childrenReactNodeCustomize panel content (replace input/output)

Status, Input, and Output labels follow the nearest ConfigProvider locale. They retain the Chinese defaults when no provider is present.

Usage Guidelines

  • Choose controlled or uncontrolled expansion. Pair open with onOpenChange; use defaultOpen only for the initial uncontrolled state.
  • children replaces the standard input and output panel, so choose one composition mode.

Related

ThinkingBlock · AgentPlan · Dossier · Artifact · ConfirmCard · ThreadList

Playground

Input

{ "q": 1 }

Output

ok
<ToolCall name="search_web" status="success" input={…} output={…} />
PreviousThinkingBlockAI AgentsNextAgentPlan

On this page

  • Usage
  • Documentation
    • When to Use
    • Import
    • Props
    • Events
    • Slots
    • Usage Guidelines
    • Related
  • Playground