list_account_transactions
Retrieve transaction history for a YNAB account to track spending, monitor cash flow, and analyze financial activity using date filters and categorization options.
Instructions
[1 API call] List transactions for a specific account
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| budget_id | No | Budget ID or 'last-used' | last-used |
| account_id | Yes | The account ID | |
| since_date | No | Only return transactions on or after this date (YYYY-MM-DD) | |
| type | No | Filter by type | |
| last_knowledge_of_server | No | Delta request token |
Implementation Reference
- src/tools/transactions.ts:293-316 (handler)The tool 'list_account_transactions' is registered and implemented in src/tools/transactions.ts. It calls the YNAB client's 'getTransactionsByAccount' method.
server.registerTool("list_account_transactions", { title: "List Account Transactions", description: "[1 API call] List transactions for a specific account", inputSchema: { budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"), account_id: z.string().describe("The account ID"), since_date: z.string().optional().describe("Only return transactions on or after this date (YYYY-MM-DD)"), type: z.enum(TRANSACTION_TYPES).optional().describe("Filter by type"), last_knowledge_of_server: z.number().optional().describe("Delta request token"), }, annotations: { readOnlyHint: true }, }, async ({ budget_id, account_id, since_date, type, last_knowledge_of_server }) => { try { const response = await getClient().transactions.getTransactionsByAccount( budget_id, account_id, since_date, type, last_knowledge_of_server ); const txns = response.data.transactions; if (txns.length === 0) return textResult("No transactions found for this account."); const lines = txns.map(formatTransaction); return textResult(`Account Transactions (${txns.length}):\n${lines.join("\n")}`); } catch (e: any) { return errorResult(e.message); } });