Spending trends
get_spending_trendsCompare monthly spending by category over past months in a YNAB budget to see whether expenses like groceries are rising or to spot month-to-month changes.
Instructions
Spending per category, month by month, over the last N months.
Use it for "is my grocery spending going up?" or to compare months. months_count counts back from the current month, included: the default 3 gives this month and the two before it, and the current one is still partial. A plan younger than that gives the months it holds. 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, so a year of months costs twelve requests; changes nothing.
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": {
"plan_id": "<plan_id>"
},
"name": "get_spending_trends"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan_id | Yes | YNAB plan id or 'last-used'. | |
| months_count | No | Number of past months to include, 1 to 24 (default 3). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||