Skip to main content
Glama
akutishevsky

LunchMoney MCP Server

update_transactions_bulk

Idempotent

Batch update 1 to 500 transactions by providing their IDs and at least one writable field. Cannot modify split or grouped transactions.

Instructions

Update multiple transactions in a single call (1-500). Each entry must include id plus at least one writable field. Cannot be used to modify split or grouped transactions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
transactionsYesArray of partial transaction updates, each keyed by its `id`.

Implementation Reference

  • Registration of the 'update_transactions_bulk' tool with MCP server, including description, input schema, and handler.
    server.registerTool(
        "update_transactions_bulk",
        {
            description:
                "Update multiple transactions in a single call (1-500). Each entry must include `id` plus at least one writable field. Cannot be used to modify split or grouped transactions.",
            inputSchema: {
                transactions: z
                    .array(
                        updateTransactionFieldsSchema.extend({
                            id: z.coerce
                                .number()
                                .describe(
                                    "ID of the transaction to update (required).",
                                ),
                        }),
                    )
                    .min(1)
                    .max(500)
                    .describe(
                        "Array of partial transaction updates, each keyed by its `id`.",
                    ),
            },
            annotations: {
                idempotentHint: true,
            },
        },
        async ({ transactions }) => {
            try {
                const response = await api.put("/transactions", {
                    transactions,
                });
    
                if (!response.ok) {
                    return handleApiError(
                        response,
                        "Failed to bulk update transactions",
                    );
                }
    
                return dataResponse(await response.json());
            } catch (error) {
                return catchError(error, "Failed to bulk update transactions");
            }
        },
    );
  • Handler function that calls api.put('/transactions', {transactions}) and returns the response.
    async ({ transactions }) => {
        try {
            const response = await api.put("/transactions", {
                transactions,
            });
    
            if (!response.ok) {
                return handleApiError(
                    response,
                    "Failed to bulk update transactions",
                );
            }
    
            return dataResponse(await response.json());
        } catch (error) {
            return catchError(error, "Failed to bulk update transactions");
        }
    },
  • Input schema: array of 1-500 transaction objects, each extending updateTransactionFieldsSchema with a required 'id' field.
    inputSchema: {
        transactions: z
            .array(
                updateTransactionFieldsSchema.extend({
                    id: z.coerce
                        .number()
                        .describe(
                            "ID of the transaction to update (required).",
                        ),
                }),
            )
            .min(1)
            .max(500)
            .describe(
                "Array of partial transaction updates, each keyed by its `id`.",
            ),
    },
  • updateTransactionFieldsSchema defines writable fields for updating a transaction.
    const updateTransactionFieldsSchema = z.object({
        date: dateString.optional(),
        amount: z.coerce.number().optional(),
        currency: z.string().length(3).optional(),
        payee: z.string().max(140).optional(),
        category_id: z.coerce.number().nullable().optional(),
        notes: z.string().max(350).nullable().optional(),
        manual_account_id: z.coerce.number().nullable().optional(),
        plaid_account_id: z.coerce.number().nullable().optional(),
        recurring_id: z.coerce.number().nullable().optional(),
        status: writeStatusEnum.optional(),
        tag_ids: z
            .array(z.coerce.number())
            .optional()
            .describe(
                "Replaces all existing tags on the transaction. Mutually exclusive with additional_tag_ids.",
            ),
        additional_tag_ids: z
            .array(z.coerce.number())
            .optional()
            .describe(
                "Adds these tags to the existing transaction tags. Mutually exclusive with tag_ids.",
            ),
        external_id: z.string().max(75).nullable().optional(),
        custom_metadata: z.record(z.unknown()).nullable().optional(),
    });
  • API client helpers: api.put() used by the handler to make the PUT /transactions request.
    export const api = {
        get: (path: string) => apiRequest("GET", path),
        post: (path: string, body?: unknown) => apiRequest("POST", path, body),
        put: (path: string, body: unknown) => apiRequest("PUT", path, body),
        delete: (path: string, body?: unknown) => apiRequest("DELETE", path, body),
        upload: (path: string, formData: FormData) =>
            apiUpload("POST", path, formData),
    };
Behavior3/5

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

The description adds constraints (entry must include id and writable field, cannot modify split/grouped) beyond the idempotentHint annotation. However, it does not disclose behavior on partial failures, response format, or permission requirements, leaving gaps.

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

Conciseness5/5

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

The description is two concise sentences that front-load the core purpose and immediately follow with key usage constraints. Every word adds value with no redundancy.

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?

For a bulk update tool with a complex input schema, the description covers the essential points: range, required fields, and restrictions. The lack of an output schema is not a major omission, but mentioning success/failure behavior would improve completeness slightly.

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

Parameters4/5

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

Schema description coverage is high (100%), with detailed field properties. The description adds semantic clarity by stating that each entry must include 'id' plus at least one writable field, which is not in the schema itself.

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 operation: updating multiple transactions in bulk with a specific range (1-500). It distinguishes from siblings like 'update_transaction' (single) and 'create_transactions' (create vs update) by emphasizing bulk updates and constraints on split/grouped transactions.

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

Usage Guidelines4/5

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

It provides explicit constraints (cannot modify split/grouped transactions) and a range limit, which guides appropriate use. While it doesn't name alternative tools like 'split_transaction' or 'update_transaction', the context is clear enough for an AI agent to infer when to avoid this tool.

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