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()),
                    },
                ],
            };
        }
    );
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden and effectively discloses critical behavioral traits: it disassociates the category from transactions, recurring items, budgets, etc., and emphasizes the action is irreversible. It doesn't cover all potential side effects like error handling or permissions, but provides substantial risk context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action, followed by critical warnings and best practice advice. Every sentence adds value, though it could be slightly tighter (e.g., combining some points). Overall efficient and well-structured for a high-risk tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the high-risk nature (destructive, irreversible), no annotations, and no output schema, the description does well by covering purpose, usage warnings, and behavioral impact. It could benefit from mentioning response format or error cases, but it's largely complete for safe agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description adds no parameter-specific information beyond what's implied by context (e.g., 'category_id' is for the category/group to delete). It doesn't explain format, constraints, or examples, so it partially compensates but leaves gaps, meeting the baseline for minimal schema support.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete a single category or category group') and the resource, distinguishing it from the sibling 'delete_category' by emphasizing the forceful, irreversible nature with disassociation from related data. It specifies the scope beyond simple deletion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly advises to first try the 'Delete Category endpoint' (presumably the sibling 'delete_category') to avoid accidental data loss, providing clear when-to-use guidance and an alternative. This directly addresses the risk and differentiates it from safer options.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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