Compare cash flow and expenses
compare_periodsUse this when the person asks for month-over-month spending, business expense changes, income comparisons, or a change in personal or business net cash flow. Returns totals, the exact change (second minus first), and percentage change in one currency. Scope to the selected accounts. Uses posted transactions and excludes internal transfers. Requires explicit dates; unequal ranges are not normalized, so compare ranges of equal length. direction picks money in (income), money out (expense), or both (all); percentage change is null when the first total is zero. Does not calculate accounting profit or forecast future balances. For one period call get_cash_flow; for a trend across many periods, get_period_totals.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"first": "<first>",
"second": "<second>",
"direction": "<direction>"
},
"name": "compare_periods"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| first | Yes | Earlier or baseline period, inclusive dates. | |
| second | Yes | Period to compare with the baseline, inclusive dates. | |
| currency | No | ISO currency, e.g. USD or CAD. Monetary summaries use one currency and never convert or combine currencies. | |
| accountId | No | Personal or business account id from list_accounts or a mention. Omit for all connected accounts; resolve the user's selected accounts first for business-only or personal-only reviews. | |
| direction | Yes | income = money in, expense = money out. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| delta | Yes | Second period minus first period. | |
| first | Yes | ||
| setup | No | Present when bank data is missing, syncing, failing, or out of date. Lead the answer with it. | |
| second | Yes | ||
| direction | Yes | ||
| percentageChange | Yes | Percentage change relative to the absolute first total; null when the first total is zero. |