Sales dashboard in chat
An internal assistant answers "how did we do this month?" with a chart from your reporting API.
Goal
“Show me this month’s sales” → get_sales { period: 'month' } → a card with a bar chart by product and a line of weekly totals.
Pieces
- Tool
get_sales:GET https://api.kletso.ai/demo/acme/reports/sales?period={{ input.period }}, schema{ period: enum [week, month, quarter] }. Point it at your BI endpoint; return small aggregates, not raw rows. - Block
chart(built-in):chartTypebar, line or pie;series[] { name, data[{x, y}] }; optionalcurrency. - Prompt line: “sales → get_sales (default period month); render as a chart (bar by product) in a card and add one sentence with the total and change.”
Verify
- Preview “sales this month” → tool call →
ui.renderwith achartnode. - The card shows the chart; the text quotes
totalandchangePctfrom the tool, nothing invented.
Notes
- Restrict this agent to signed-in staff with a host JWT and a plan/tier claim, and add a condition in the prompt or your API.
- For very large numbers pass
currency: "USD"so the chart formats axes.