delete_transaction_group
Remove a transaction group or individual transaction from your LunchMoney financial data by specifying its ID to maintain accurate records.
Instructions
Delete a transaction group or a single transaction.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes |
Implementation Reference
- src/tools/transactions.ts:596-628 (handler)Handler function that performs DELETE request to Lunchmoney API to delete transaction group by ID.async ({ input }) => { const { baseUrl, lunchmoneyApiToken } = getConfig(); const response = await fetch( `${baseUrl}/transactions/group/${input.transaction_id}`, { method: "DELETE", headers: { Authorization: `Bearer ${lunchmoneyApiToken}`, }, } ); if (!response.ok) { return { content: [ { type: "text", text: `Failed to delete transaction group: ${response.statusText}`, }, ], }; } return { content: [ { type: "text", text: "Transaction group deleted successfully", }, ], }; }
- src/tools/transactions.ts:589-595 (schema)Zod input schema defining transaction_id as a required number.{ input: z.object({ transaction_id: z .number() .describe("ID of the transaction group to delete"), }), },
- src/tools/transactions.ts:587-629 (registration)Registration of the delete_transaction_group tool with server.tool, including description, schema, and inline handler."delete_transaction_group", "Delete a transaction group or a single transaction.", { input: z.object({ transaction_id: z .number() .describe("ID of the transaction group to delete"), }), }, async ({ input }) => { const { baseUrl, lunchmoneyApiToken } = getConfig(); const response = await fetch( `${baseUrl}/transactions/group/${input.transaction_id}`, { method: "DELETE", headers: { Authorization: `Bearer ${lunchmoneyApiToken}`, }, } ); if (!response.ok) { return { content: [ { type: "text", text: `Failed to delete transaction group: ${response.statusText}`, }, ], }; } return { content: [ { type: "text", text: "Transaction group deleted successfully", }, ], }; } );