get_spending_trends
What it does
Section titled “What it does”Spending per category, month by month, over the last N months.
Use it for “is my grocery spending going up?” or to compare months. The result maps each category name to its spending month by month, oldest first, as a positive number in currency units. For a single month use get_category_balances or get_budget_vs_actual; for the months ahead, forecast_balance. One YNAB request for the list of months, then one per month; changes nothing.
Behaviour
Section titled “Behaviour”| Kind | read-only |
| Confirmation | no |
| Undo | no |
| Idempotent | yes |
| YNAB requests | 4 for the example below, on a cold cache |
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
plan_id |
string | yes | — | YNAB plan id or ‘last-used’. |
months_count |
integer | no | 3 |
Number of past months to include, 1 to 24 (default 3). |
Returns
Section titled “Returns”object
Example
Section titled “Example”Arguments:
{ "plan_id": "demo-budget", "months_count": 3}Answer on the demo budget:
{ "Rent": [ { "month": "2026-07-01", "amount": 950.0 }, { "month": "2026-08-01", "amount": 950.0 }, { "month": "2026-09-01", "amount": 950.0 } ], "Electricity": [ { "month": "2026-07-01", "amount": 64.2 }, { "month": "2026-08-01", "amount": 64.2 }, { "month": "2026-09-01", "amount": 64.2 } ], "Internet": [ { "month": "2026-07-01", "amount": 29.99 }, { "month": "2026-08-01", "amount": 29.99 }, { "month": "2026-09-01", "amount": 29.99 } ], "Phone": [ { "month": "2026-07-01", "amount": 19.99 }, { "month": "2026-08-01", "amount": 19.99 }, { "month": "2026-09-01", "amount": 19.99 } ], "Groceries": [ { "month": "2026-07-01", "amount": 172.89 }, { "month": "2026-08-01", "amount": 192.51 }, { "month": "2026-09-01", "amount": 0.0 } ], "Restaurants": [ { "month": "2026-07-01", "amount": 61.5 }, { "month": "2026-08-01", "amount": 89.1 }, { "month": "2026-09-01", "amount": 142.5 } ], "Transport": [ { "month": "2026-07-01", "amount": 45.0 }, { "month": "2026-08-01", "amount": 45.0 }, { "month": "2026-09-01", "amount": 0.0 } ], "Tennis": [ { "month": "2026-07-01", "amount": 22.0 }, { "month": "2026-08-01", "amount": 22.0 }, { "month": "2026-09-01", "amount": 0.0 } ], "Subscriptions": [ { "month": "2026-07-01", "amount": 13.49 }, { "month": "2026-08-01", "amount": 13.49 }, { "month": "2026-09-01", "amount": 0.0 } ], "Holidays": [ { "month": "2026-07-01", "amount": 0.0 }, { "month": "2026-08-01", "amount": 0.0 }, { "month": "2026-09-01", "amount": 0.0 } ]}Errors
Section titled “Errors”This tool raises no error of its own; YNAB’s errors come back as Error calling tool '<tool>': YNAB <status>: <detail>.
See also
Section titled “See also”Unofficial project. We are not affiliated, associated, or in any way officially connected with YNAB or any of its subsidiaries or affiliates. The official YNAB website can be found at https://www.ynab.com. The names YNAB and You Need A Budget, as well as related names, tradenames, marks, trademarks, emblems, and images are registered trademarks of YNAB. avenir-mcp is provided as is, without warranty, and is not financial advice. Legal notice · Privacy