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): chartType bar, line or pie; series[] { name, data[{x, y}] }; optional currency.
  • 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.render with a chart node.
  • The card shows the chart; the text quotes total and changePct from 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.

Last updated 2026-09-28 · Report an issue with this page