delete_transactions_bulk
Permanently delete up to 500 transactions by their IDs. Note: cannot delete split or group parents or members; unsplit or ungroup them first.
Instructions
Bulk-delete transactions by ID (1-500). Fails if any ID is a split or group parent, or part of a split/group; unsplit or ungroup those first. Irreversible.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | Yes | Array of transaction IDs to delete (1-500). |
Implementation Reference
- src/tools/transactions.ts:515-536 (handler)The handler function for the delete_transactions_bulk tool. It calls api.delete('/transactions', { ids }) with the provided transaction IDs. On a 204 response, it returns a success message; otherwise, it handles errors appropriately.
async ({ ids }) => { try { const response = await api.delete("/transactions", { ids }); if (response.status === 204) { return successResponse( `Deleted ${ids.length} transaction(s).`, ); } if (!response.ok) { return handleApiError( response, "Failed to bulk delete transactions", ); } return dataResponse(await response.json()); } catch (error) { return catchError(error, "Failed to bulk delete transactions"); } }, - src/tools/transactions.ts:503-510 (schema)Input schema for delete_transactions_bulk: accepts an array of 1-500 numeric transaction IDs.
"Bulk-delete transactions by ID (1-500). Fails if any ID is a split or group parent, or part of a split/group; unsplit or ungroup those first. Irreversible.", inputSchema: { ids: z .array(z.coerce.number()) .min(1) .max(500) .describe("Array of transaction IDs to delete (1-500)."), }, - src/tools/transactions.ts:499-537 (registration)Registration of the delete_transactions_bulk tool via server.registerTool(), including description, input schema, destructive annotation, and the handler callback.
server.registerTool( "delete_transactions_bulk", { description: "Bulk-delete transactions by ID (1-500). Fails if any ID is a split or group parent, or part of a split/group; unsplit or ungroup those first. Irreversible.", inputSchema: { ids: z .array(z.coerce.number()) .min(1) .max(500) .describe("Array of transaction IDs to delete (1-500)."), }, annotations: { destructiveHint: true, }, }, async ({ ids }) => { try { const response = await api.delete("/transactions", { ids }); if (response.status === 204) { return successResponse( `Deleted ${ids.length} transaction(s).`, ); } if (!response.ok) { return handleApiError( response, "Failed to bulk delete transactions", ); } return dataResponse(await response.json()); } catch (error) { return catchError(error, "Failed to bulk delete transactions"); } }, );