list_month_transactions
Retrieve and filter transactions for a specific month from YNAB budgets to track spending, monitor categories, and review financial activity.
Instructions
[1 API call] List transactions 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) | |
| since_date | No | Only return transactions on or after this date | |
| type | No | Filter by type | |
| last_knowledge_of_server | No | Delta request token |
Implementation Reference
- src/tools/transactions.ts:368-378 (registration)Registration of the list_month_transactions tool.
server.registerTool("list_month_transactions", { title: "List Month Transactions", description: "[1 API call] List transactions 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)"), since_date: z.string().optional().describe("Only return transactions on or after this date"), type: z.enum(TRANSACTION_TYPES).optional().describe("Filter by type"), last_knowledge_of_server: z.number().optional().describe("Delta request token"), }, annotations: { readOnlyHint: true }, - src/tools/transactions.ts:379-391 (handler)Handler implementation for the list_month_transactions tool.
}, async ({ budget_id, month, since_date, type, last_knowledge_of_server }) => { try { const response = await getClient().transactions.getTransactionsByMonth( budget_id, month, since_date, type, last_knowledge_of_server ); const txns = response.data.transactions; if (txns.length === 0) return textResult(`No transactions found for ${month}.`); const lines = txns.map(formatTransaction); return textResult(`Month Transactions for ${month} (${txns.length}):\n${lines.join("\n")}`); } catch (e: any) { return errorResult(e.message); } });