remove_budget
Delete a budget assigned to a specific category for a given month in LunchMoney, helping users manage their financial planning by removing outdated or incorrect budget allocations.
Instructions
Remove a budget for a specific category and month
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes |
Implementation Reference
- src/tools/budgets.ts:149-183 (handler)The handler function for the 'remove_budget' tool. It constructs a DELETE request to the Lunch Money API to remove the budget for the specified category and month, returning success or error message.async ({ input }) => { const { baseUrl, lunchmoneyApiToken } = getConfig(); const params = new URLSearchParams({ start_date: input.start_date, category_id: input.category_id.toString(), }); const response = await fetch(`${baseUrl}/budgets?${params}`, { method: "DELETE", headers: { Authorization: `Bearer ${lunchmoneyApiToken}`, }, }); if (!response.ok) { return { content: [ { type: "text", text: `Failed to remove budget: ${response.statusText}`, }, ], }; } return { content: [ { type: "text", text: "Budget removed successfully", }, ], }; }
- src/tools/budgets.ts:140-147 (schema)Zod input schema defining parameters for the 'remove_budget' tool: start_date (string) and category_id (number).input: z.object({ start_date: z .string() .describe("Budget month start date in YYYY-MM-DD format"), category_id: z .number() .describe("Category ID for the budget to remove"), }),
- src/tools/budgets.ts:136-184 (registration)Registration of the 'remove_budget' tool on the MCP server within the registerBudgetTools function, including description, input schema, and inline handler.server.tool( "remove_budget", "Remove a budget for a specific category and month", { input: z.object({ start_date: z .string() .describe("Budget month start date in YYYY-MM-DD format"), category_id: z .number() .describe("Category ID for the budget to remove"), }), }, async ({ input }) => { const { baseUrl, lunchmoneyApiToken } = getConfig(); const params = new URLSearchParams({ start_date: input.start_date, category_id: input.category_id.toString(), }); const response = await fetch(`${baseUrl}/budgets?${params}`, { method: "DELETE", headers: { Authorization: `Bearer ${lunchmoneyApiToken}`, }, }); if (!response.ok) { return { content: [ { type: "text", text: `Failed to remove budget: ${response.statusText}`, }, ], }; } return { content: [ { type: "text", text: "Budget removed successfully", }, ], }; } );