Every analytics capability in the Financial Analytics Agent follows a strict 1:1:1 pattern: one tool (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/astrxnomo/financial-analytics-agent/llms.txt
Use this file to discover all available pages before exploring further.
agent/tools/<name>.ts) paired with one REST route (app/api/finance/<name-kebab>/route.ts) and one chart component (app/_components/tool-result/<name>.tsx). All three call agent/lib/finance.ts directly — the agent never crosses an HTTP boundary to reach its own data, so it works standalone under eve dev --no-ui with no Next.js process running. Types are defined once in agent/lib/finance.types.ts and shared across tools, routes, and chart components.
get_summary
Returns total income, total expense, and net for a date range (inclusive on both ends). Input:{ from: string, to: string } — both dates in YYYY-MM-DD format.
Return type: Summary
get_summary for whole-company financial totals over a date range. Do not use it for row counts or dataset metadata (use get_data_overview instead), and do not use it for per-department profit/margin breakdowns (use get_profitability).
get_trend
Returns a monthly time series of income or expense, optionally split by department. Input:TrendPoint[]
get_trend for “over time”, “growth”, “trend”, or “by department over time” questions. Use groupBy: "department" only when comparing across departments — defaulting to "month" keeps the chart uncluttered for single-series questions. Pass specific departments when the user names them so the chart doesn’t dilute the comparison with every other team. For the spend composition within a period (not the trend), use get_category_breakdown instead.
get_category_breakdown
Returns monthly per-category totals (spend mix or revenue mix over time). Input:{ slices: CategorySlice[]; otherCategories: string[] }
otherCategories — the exact list of categories folded into the chart’s “Other” band. The CATEGORY_BREAKDOWN_TOP_N constant (currently 8) controls how many named categories appear before the rest are grouped.
Example question: “Where does Engineering’s budget go each month?”
When to use vs. other tools: Use get_category_breakdown for “what do we spend on”, “spend composition”, “breakdown by category”, or “where does the money go” questions. Pass category when the user asks about one specific category (e.g. “is the Cloud Infrastructure spike recurring”) to isolate that series rather than burying it in a multi-category chart. If the user asks what’s in the “Other” band, quote otherCategories directly from the tool result — do not re-derive it manually from the raw slices.
get_cashflow
Returns monthly income vs. expense with both the monthly net and the running cumulative net. Input:{ from: string, to: string } — both dates in YYYY-MM-DD format.
Return type: CashflowPoint[]
get_cashflow for “cash flow”, “burn rate”, “are we profitable over time”, and “net position” questions. The key distinction from get_summary is that cashflow is a time series — it shows how the balance evolved month by month, not just the endpoint totals. For profitability broken out by department (not over time), use get_profitability.
get_budget_status
Returns per-department budget vs. actual expense for one month only, with variance and percentage of budget used. Input:BudgetRow[]
get_budget_status for “over budget”, “budget status”, or “budget vs. actual” questions. There is no multi-month or annual budget aggregation — this tool covers exactly one month. If a question implies a longer window (“this year”, “over the last few months”), answer using the single latest closed month and say so explicitly (e.g. “for June 2026, the latest closed month”) rather than implying it covers the whole year.
get_anomalies
Returns expense transactions that exceed the statistical outlier threshold for their category within the requested date range. Input:Anomaly[]
departments or categories filters. Only the returned list is narrowed — so the σ deviation labels on each anomaly are always calibrated against the same baseline.
Example question: “Any unusual transactions this year?”
When to use vs. other tools: Use get_anomalies for “unusual”, “anomaly”, “outlier”, or “suspicious spend” questions. Lower threshold toward 2 to surface more outliers for “any unusual spend” questions; raise it to 3 or higher for “only the most extreme outliers”. When the user names specific departments or categories, always pass them to narrow the list — returning every anomaly across the company when the user asked about one team is noise.
get_profitability
Returns income, expense, net, and margin per department for a date range, sorted most-profitable-first. Input:ProfitByDept[]
margin is null for departments that booked no income (Marketing, Operations, Finance). These are cost centers — a null margin means “not applicable”, not a data gap or a zero-margin break-even.
Example question: “Which department is the most profitable and which is the biggest cost center?”
When to use vs. other tools: Use get_profitability for “most/least profitable department”, “profit/margin by team”, or “net contributors vs. cost centers” questions. get_summary only totals the whole company. get_cashflow tracks profitability over time for the whole company, not across departments. This is the only tool that pairs a department’s revenue against its spend.
get_data_overview
Returns metadata about the dataset itself: row counts and date coverage. Input: none (no parameters). Return type:DataOverview
get_data_overview for questions about the data itself — record counts, coverage dates, how many departments or categories are tracked. Never use get_summary for these, since that returns financial totals (income/expense), not row counts.
Tool selection guide
| Question type | Correct tool |
|---|---|
| Trends, growth, over-time series | get_trend |
| Over/under budget, budget vs. actual | get_budget_status |
| Unusual, suspicious, or outlier spend | get_anomalies |
| Whole-company totals (income, expense, net) | get_summary |
| Spend or revenue mix by category | get_category_breakdown |
| Cash flow, burn rate, cumulative net over time | get_cashflow |
| Profit, margin, net contribution by department | get_profitability |
| Record counts, coverage dates, dataset metadata | get_data_overview |
getHighlights() is an internal library function with no corresponding agent tool. It powers the /api/finance/highlights REST endpoint, which is consumed by useFinanceHighlights in app/_components/agent-chat/use-finance-highlights.ts to generate the suggested question chips and inject live date ranges into the agent’s instructions each session. Because it runs before the user’s first message, it adds zero latency to the agent’s response path.