Skip to main content
Glama
akutishevsky

LunchMoney MCP Server

force_delete_category

Permanently delete a category or category group from LunchMoney, removing all associated transactions, recurring items, and budgets. This action is irreversible and should only be used after verifying data with the standard delete endpoint.

Instructions

Delete a single category or category group and along with it, disassociate the category from any transactions, recurring items, budgets, etc. Note: it is best practice to first try the Delete Category endpoint to ensure you don't accidentally delete any data. Disassociation/deletion of the data arising from this endpoint is irreversible!

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes

Implementation Reference

  • Handler function that executes the force deletion of a category or category group by sending a DELETE request to the Lunchmoney API's force delete endpoint.
    async ({ input }) => { const { category_id } = input; const { baseUrl, lunchmoneyApiToken } = getConfig(); const response = await fetch( `${baseUrl}/categories/${category_id}/force`, { method: "DELETE", headers: { Authorization: `Bearer ${lunchmoneyApiToken}`, }, } ); if (!response.ok) { return { content: [ { type: "text", text: `Failed to force delete a single category or category group: ${response.statusText}`, }, ], }; } return { content: [ { type: "text", text: JSON.stringify(await response.json()), }, ], }; }
  • Input schema validation using Zod for the force_delete_category tool, specifying the category_id parameter.
    input: z.object({ category_id: z .number() .optional() .describe( "Id of the category or the category group to delete." ), }), },
  • Registration of the force_delete_category tool using McpServer.tool(), including name, description, input schema, and handler function.
    server.tool( "force_delete_category", "Delete a single category or category group and along with it, disassociate the category from any transactions, recurring items, budgets, etc. Note: it is best practice to first try the Delete Category endpoint to ensure you don't accidentally delete any data. Disassociation/deletion of the data arising from this endpoint is irreversible!", { input: z.object({ category_id: z .number() .optional() .describe( "Id of the category or the category group to delete." ), }), }, async ({ input }) => { const { category_id } = input; const { baseUrl, lunchmoneyApiToken } = getConfig(); const response = await fetch( `${baseUrl}/categories/${category_id}/force`, { method: "DELETE", headers: { Authorization: `Bearer ${lunchmoneyApiToken}`, }, } ); if (!response.ok) { return { content: [ { type: "text", text: `Failed to force delete a single category or category group: ${response.statusText}`, }, ], }; } return { content: [ { type: "text", text: JSON.stringify(await response.json()), }, ], }; } );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/akutishevsky/lunchmoney-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server