delete_transaction
Remove a transaction from your YNAB budget to correct errors or update financial records. Specify the budget and transaction ID to delete unwanted entries.
Instructions
[1 API call] Delete a transaction
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| budget_id | No | Budget ID or 'last-used' | last-used |
| transaction_id | Yes | The transaction ID to delete |
Implementation Reference
- src/tools/transactions.ts:256-263 (registration)Registration of the delete_transaction tool including input schema.
server.registerTool("delete_transaction", { title: "Delete Transaction", description: "[1 API call] Delete a transaction", inputSchema: { budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"), transaction_id: z.string().describe("The transaction ID to delete"), }, annotations: { readOnlyHint: false, destructiveHint: true }, - src/tools/transactions.ts:264-272 (handler)Implementation handler for the delete_transaction tool.
}, async ({ budget_id, transaction_id }) => { try { const response = await getClient().transactions.deleteTransaction(budget_id, transaction_id); const t = response.data.transaction; return textResult(`Deleted transaction: ${t.date} | ${formatCurrency(t.amount)} | ${t.payee_name ?? "No payee"}\nID: ${t.id}`); } catch (e: any) { return errorResult(e.message); } });