For AI agents: the complete documentation index is available at https://a3s-lab.github.io/UI/v0.4.0/en/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/UI/v0.4.0/en/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/UI/v0.4.0/en/components/tool-call.md.

Tool Call

Tool Call turns one external capability execution into an auditable name, input, progress, result, and recovery path. Its collapsed summary answers what is happening, which integration owns it, and its current state; potentially long input and output stay behind the disclosure.

Repository search in progress
Find permission boundary implementationssearch · rg "permission|policy" src1.8 sRunning
Working directory /workspace/uiCall ID call_8f42Output redacted
ArgumentsJSON
{"query":"permission|policy","path":"src","limit":200}
Live output3 matches
src/security/policy.ts:42: export function authorize(...)
src/runtime/permission.ts:18: type PermissionDecision = ...
tests/policy.spec.ts:71: expect(decision).toEqual(...)
68%

Product boundary

Tool Call is not a generic log container. It preserves the information a person needs to decide whether an execution is trustworthy without dumping provider-internal fields into the interface.

  • Use an intent-level title such as “Read configuration,” not only shell_command.
  • Distinguish preparing, awaiting approval, running, succeeded, denied, failed, timed out, and interrupted.
  • Enter awaiting before a risky operation and let the host render explicit approve and deny actions.
  • Separate input, output, and error. Long content keeps its own scroll boundary instead of expanding the task timeline indefinitely.
  • Retry, stop, copy, and open-file actions emit events; networking, authorization, and auditing remain host responsibilities.

Controller

MethodResult
setState(state, options)Synchronizes state, label, duration, and error, then emits a state event
setProgress(value)Sets determinate 0–100 progress; a non-number restores indeterminate progress
appendOutput(chunk)Appends streaming output and emits a3s:tool-output-change
setOutput(output)Atomically replaces output for non-streaming results
openCall() / close() / toggle(force)Controls the native <details> disclosure
runAction(action)Emits a host action after a cancelable authorization event
getState()Returns an immutable state, progress, duration, output, and disclosure snapshot

Prefer preparing, awaiting, running, succeeded, failed, denied, timed-out, and interrupted. The legacy queued, waiting, success, cancelled, and error states remain compatible.

Accessibility and security

The action name and state in the summary cannot rely on color or an icon alone. The runtime exposes running state through aria-busy; an approval flow moves focus to real buttons, and completion produces one polite status announcement. Remove tokens, cookies, secrets, and personal data before rendering. Copy only the already-redacted visible output.