create_account
Add a new account to your YNAB budget by specifying name, type, and starting balance to organize your financial tracking.
Instructions
[1 API call] Create a new account in a budget
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| budget_id | No | Budget ID or 'last-used' | last-used |
| name | Yes | Account name | |
| type | Yes | Account type | |
| balance | Yes | Starting balance in dollars (e.g., 1000.50) |
Implementation Reference
- src/tools/accounts.ts:67-87 (handler)The implementation and registration of the 'create_account' tool in src/tools/accounts.ts.
server.registerTool("create_account", { title: "Create Account", description: "[1 API call] Create a new account in a budget", inputSchema: { budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"), name: z.string().describe("Account name"), type: z.enum(ACCOUNT_TYPES).describe("Account type"), balance: z.number().describe("Starting balance in dollars (e.g., 1000.50)"), }, annotations: { readOnlyHint: false }, }, async ({ budget_id, name, type, balance }) => { try { const response = await getClient().accounts.createAccount(budget_id, { account: { name, type, balance: Math.round(balance * 1000) }, }); const a = response.data.account; return textResult(`Created account "${a.name}" (${a.type}) with balance ${formatCurrency(a.balance)}\nID: ${a.id}`); } catch (e: any) { return errorResult(e.message); } });