get_spending_trends
What it does
Section titled “What it does”Return monthly spending trends per category over the last N months.
The result maps each category name to its spending month by month, oldest first, in currency units.
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 (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": 0.0 } ], "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. YNAB and You Need A Budget are registered trademarks of YNAB. avenir-mcp is provided as is, without warranty, and is not financial advice. Legal notice