Learn how to define tools that let the agent trigger client-side effects.

Core capabilities
- No interruption: does not wait for the frontend to respond
- One-way notification: model → frontend UI
- Automatic return value: uses the middleware-configured Result
- Strong UI control: the model can “drive UI changes”
Workflow
- Configure the Client Effect middleware on the server
- Define
Tool Name / Description / Arguments Schema - Configure a fixed
Result
- Model triggers the effect
- The LLM calls the effect tool (for example,
show_station)
- Frontend receives and executes
- ChatKit sends the event via
onEffect - The frontend performs the UI side effect (state update, focus, etc.)
- Model continues reasoning
- It does not wait for frontend completion
Server configuration essentials
Tool NameFrontend (React) integration
RegisteronEffect in useChatKit:
Client Tool vs. Client Effect
| Item | Client Tool | Client Effect |
|---|---|---|
| Interrupts reasoning | ✅ Yes | ❌ No |
| Waits for frontend result | ✅ Yes | ❌ No |
| Dynamic result | ✅ Yes | ❌ No (fixed Result) |
| Best for | State reads / user confirmation | UI updates / display / focus |
Best practices
- Effects handle UI side effects only; keep business decisions elsewhere
namemust exactly match the server tool namedatashould include only the minimal fields needed by the frontend- Avoid long-running or blocking tasks inside effects
Client effects let the model declaratively drive UI behavior, which is key for building visual, highly interactive agent experiences.