You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -54,16 +55,24 @@ For operators deploying Managed Agents to their own customers and needing per-se
54
55
55
56
For self-hosted Lago, replace `LAGO_API_URL` with your instance URL.
56
57
58
+
> **Analytics tool**: `ask_lago_analytics` additionally requires `LAGO_AGENT_API_URL` (the URL of the Lago analytics agent). If it's not set, the other tools work normally and only the analytics tool returns a configuration error. Note: this tool forwards your `X-LAGO-API-KEY` to the analytics agent service (a first-party Lago service that re-validates the key and applies the same per-organization row-level security as the Rails API). It is the one tool that does not route through the Lago REST API — see the PR description / `docs/` for the architecture rationale.
59
+
57
60
## Example prompts
58
61
59
62
-*"Show me all pending invoices from last month"* → `list_invoices`
60
63
-*"Find all failed payment invoices"* → `list_invoices`
61
64
-*"Give me the total amount of overdue invoices for March 2025"* → `list_invoices` + agent aggregation
62
65
-*"Preview an invoice for customer X with 500 additional API-call events"* → `preview_invoice`
63
66
-*"Retry payment on invoice INV-123"* → `retry_invoice_payment`
67
+
-*"What was our MRR for December 2025, broken down by plan?"* → `ask_lago_analytics`
68
+
-*"List the top 10 customers by usage volume in Q1 2026."* → `ask_lago_analytics`
69
+
-*"How many invoices went overdue last month?"* then *"Break that down by customer country."* → `ask_lago_analytics` (the second call reuses the returned `session_id`)
64
70
65
71
## Available Tools
66
72
73
+
### Analytics
74
+
-**`ask_lago_analytics`**: Ask a natural-language question about your billing and usage data (revenue, MRR, invoices, customers, subscriptions, usage volumes). The analytics agent generates a read-only SQL query, runs it, and returns the SQL, a plain-language explanation, and a results table. The response includes a `session_id` — pass it back on a follow-up call to refine the same result (filter, aggregate, sort) using the agent's cached rows.
75
+
67
76
### Invoices
68
77
-**`find_invoice_by_number`**: Find an invoice by its number (e.g., "RAF-8142-202601-312") and get its Lago ID
69
78
-**`get_invoice`**: Retrieve a specific invoice by Lago ID
0 commit comments