Skip to main content
Glama
akutishevsky

LunchMoney MCP Server

update_transaction

Idempotent

Update an existing transaction's fields such as date, amount, payee, category, status, and tags. Cannot modify split or grouped transactions.

Instructions

Update an existing transaction. Provide any subset of writable fields directly (the v2 API no longer wraps the body in a transaction envelope). Cannot modify split or grouped transactions; use the corresponding split/group tools instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
transaction_idYesID of the transaction to update.
updateYesFields to update. Provide at least one writable field.
update_balanceNoDefaults to true. Pass false to skip updating the associated manual account's balance.

Implementation Reference

  • Schema defining the writable fields for updating a transaction (all optional).
    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(),
    });
  • Handler function that executes the update_transaction tool logic: sends a PUT request to the Lunchmoney API with the transaction_id and update fields.
    async ({ transaction_id, update, update_balance }) => {
        try {
            const path =
                update_balance === undefined
                    ? `/transactions/${transaction_id}`
                    : `/transactions/${transaction_id}?update_balance=${update_balance}`;
            const response = await api.put(path, update);
    
            if (!response.ok) {
                return handleApiError(
                    response,
                    "Failed to update transaction",
                );
            }
    
            return dataResponse(await response.json());
        } catch (error) {
            return catchError(error, "Failed to update transaction");
        }
    },
  • Registration of the 'update_transaction' tool on the MCP server, including description, input schema, and annotations.
    server.registerTool(
        "update_transaction",
        {
            description:
                "Update an existing transaction. Provide any subset of writable fields directly (the v2 API no longer wraps the body in a `transaction` envelope). Cannot modify split or grouped transactions; use the corresponding split/group tools instead.",
            inputSchema: {
                transaction_id: z.coerce
                    .number()
                    .describe("ID of the transaction to update."),
                update: updateTransactionFieldsSchema.describe(
                    "Fields to update. Provide at least one writable field.",
                ),
                update_balance: z
                    .boolean()
                    .optional()
                    .describe(
                        "Defaults to true. Pass false to skip updating the associated manual account's balance.",
                    ),
            },
            annotations: {
                idempotentHint: true,
            },
        },
        async ({ transaction_id, update, update_balance }) => {
            try {
                const path =
                    update_balance === undefined
                        ? `/transactions/${transaction_id}`
                        : `/transactions/${transaction_id}?update_balance=${update_balance}`;
                const response = await api.put(path, update);
    
                if (!response.ok) {
                    return handleApiError(
                        response,
                        "Failed to update transaction",
                    );
                }
    
                return dataResponse(await response.json());
            } catch (error) {
                return catchError(error, "Failed to update transaction");
            }
        },
    );
  • The api.put() helper used by the handler to make the PUT request to the Lunchmoney API.
    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),
Behavior4/5

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

Annotations only provide idempotentHint; description adds key behavioral details: API v2 format change (no envelope) and restriction on split/group. No contradictions with annotations.

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?

Two sentences with no redundant information. Main action front-loaded, followed by key constraints and alternative references.

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?

Covers critical constraints and API format for this mutation tool. Does not describe return values, but no output schema exists; overall sufficient for a well-documented schema.

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 coverage is 100%, so baseline is 3. Description adds minor context about 'any subset of writable fields' and API change, but does not elaborate on individual parameters, which are well-documented in schema.

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?

Clearly states 'Update an existing transaction,' specifying verb and resource. Explicitly differentiates from siblings by noting it cannot modify split or grouped transactions and directs to alternative tools.

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?

Provides clear context on when not to use (split/grouped transactions) and suggests alternatives. Does not explicitly enumerate all use cases but gives strong directional guidance.

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