get_month_money_movements
Retrieve monthly financial transactions and money movements from YNAB budgets to track income, expenses, and cash flow for specific periods.
Instructions
[1 API call] Get money movements for a specific month
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| budget_id | No | Budget ID or 'last-used' | last-used |
| month | Yes | Month in YYYY-MM-DD format (first of month) or 'current' |
Implementation Reference
- src/tools/money-movements.ts:30-52 (handler)Implementation of the 'get_month_money_movements' tool handler.
server.registerTool("get_month_money_movements", { title: "Get Month Money Movements", description: "[1 API call] Get money movements for a specific month", inputSchema: { budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"), month: z.string().describe("Month in YYYY-MM-DD format (first of month) or 'current'"), }, annotations: { readOnlyHint: true }, }, async ({ budget_id, month }) => { try { const response = await getMoneyMovementsClient().getMoneyMovementsByMonth(budget_id, month); const movements = response.data.money_movements; if (!movements || movements.length === 0) return textResult(`No money movements found for ${month}.`); const lines = movements.map((m) => { const from = m.from_category_id ?? "Ready to Assign"; const to = m.to_category_id ?? "Ready to Assign"; return `- ${formatCurrency(m.amount)}: ${from} -> ${to} ${m.note ? `(${m.note})` : ""}`; }); return textResult(`Money Movements for ${month} (${movements.length}):\n${lines.join("\n")}`); } catch (e: any) { return errorResult(e.message); } });