window.crow('registerTools', {...}), and the agent calls them like any other tool — but the work happens client-side.
When to Use
Use client-side tools for browser-only actions:- CSV/file downloads
- Page navigation
- DOM manipulation
- Accessing client-side state (stores, localStorage)
Setup
1. Register Handlers
In your app code, register functions the widget can call:2. Upload Tool Definitions
On the Actions page, upload a JSON definition so the agent knows the tool exists:Handler Contract
Each handler receives anargs object matching the tool’s parameters schema and must return an object.
| Outcome | Return value |
|---|---|
| Success | { status: "success", ...data } |
| Failure | { status: "error", error: "message" } |
Showing a Loading State
For tools that take a few seconds, callsetToolStatus to show a spinning indicator with a status message inside the widget. Clear it when done.
''.
How It Works
- User asks — The message is sent to the agent
- Agent picks the tool — Based on the tool definition
- Widget runs the handler — Executes your registered function client-side
- Result flows back — The agent sees the return value and responds
