Tool renderers let you display custom UI — like charts, tables, or cards — directly inside the chat when a server-side tool returns data.Documentation Index
Fetch the complete documentation index at: https://docs.usecrow.ai/llms.txt
Use this file to discover all available pages before exploring further.
How It Works
- Agent calls a tool — The backend executes a server-side tool and returns structured data
- Result arrives via SSE — The
tool_resultevent streams back with the tool name and result payload - Widget checks
toolRenderers— If a renderer exists for that tool name, it renders your component - Custom component appears inline — Your chart/table/card renders directly below the tool call status
Setup
1. Define Your Renderers
Create React components that accept{ result, status } props:
2. Pass to CrowCopilot
Renderer Props
Each renderer receives:| Prop | Type | Description |
|---|---|---|
result | unknown | The full result payload from the tool execution |
status | string | Tool status: "complete" or "error" |
Renderers are only called when the tool completes successfully (
status === "complete") and the result is not null. You don’t need to check for these conditions.Example: Chart Renderer
Here’s a full example rendering a Recharts line chart from analytics tool results:TypeScript
Import theToolRenderers type for type-safe renderer maps:
Without a Renderer
When notoolRenderers entry exists for a tool, the widget shows the default behavior: a checkmark with the tool name and “done” status. Adding a renderer enhances this — it doesn’t replace the status indicator, it adds your component below it.
Embed Widget
Full installation guide
Client-Side Tools
Browser-side tool handlers
