Skip to main content
Glama
akutishevsky

LunchMoney MCP Server

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
NameRequiredDescriptionDefault
inputYes

Implementation Reference

  • 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",
                },
            ],
        };
    }
  • 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"),
        }),
    },
  • 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",
                    },
                ],
            };
        }
    );

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