list_accounts
Retrieve all accounts for a YNAB budget to view account names, types, balances, and status. Use this tool to manage your budget by accessing detailed account information.
Instructions
Get all accounts for a budget. Returns account names, types, balances, and status.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| budget_id | Yes | The budget ID |
Implementation Reference
- src/index.ts:325-329 (handler)Handles the "list_accounts" tool call by validating input with BudgetIdSchema and invoking the YNABClient.listAccounts method.case "list_accounts": { const { budget_id } = BudgetIdSchema.parse(args); result = await client.listAccounts(budget_id); break; }
- src/index.ts:116-118 (schema)Zod schema used to validate the budget_id input parameter for the list_accounts tool.const BudgetIdSchema = z.object({ budget_id: z.string().describe("The budget ID (use 'last-used' for most recent)"), });
- src/index.ts:171-181 (registration)Registers the "list_accounts" tool with its metadata for the MCP list_tools request.{ name: "list_accounts", description: "Get all accounts for a budget. Returns account names, types, balances, and status.", inputSchema: { type: "object" as const, properties: { budget_id: { type: "string", description: "The budget ID" }, }, required: ["budget_id"], }, },
- src/index.ts:45-47 (helper)YNABClient helper method that fetches the list of accounts via the YNAB API for the given budget.async listAccounts(budgetId: string) { return this.request<{ accounts: any[] }>(`/budgets/${budgetId}/accounts`); }