Skip to main content
Glama
akutishevsky

LunchMoney MCP Server

update_asset

Modify an existing manually-managed asset in LunchMoney by updating details such as balance, type, currency, or institution information to maintain accurate personal finance tracking.

Instructions

Update an existing manually-managed asset

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes

Implementation Reference

  • Handler function that constructs a PUT request to the Lunchmoney API endpoint `/assets/{asset_id}` to update the specified asset with provided fields.
    async ({ input }) => {
        const { baseUrl, lunchmoneyApiToken } = getConfig();
        
        const body: any = {};
        
        if (input.type_name) body.type_name = input.type_name;
        if (input.subtype_name) body.subtype_name = input.subtype_name;
        if (input.name) body.name = input.name;
        if (input.display_name) body.display_name = input.display_name;
        if (input.balance !== undefined) body.balance = input.balance.toString();
        if (input.balance_as_of) body.balance_as_of = input.balance_as_of;
        if (input.currency) body.currency = input.currency;
        if (input.institution_name) body.institution_name = input.institution_name;
        if (input.closed_on) body.closed_on = input.closed_on;
        if (input.exclude_transactions !== undefined) body.exclude_transactions = input.exclude_transactions;
        
        const response = await fetch(`${baseUrl}/assets/${input.asset_id}`, {
            method: "PUT",
            headers: {
                Authorization: `Bearer ${lunchmoneyApiToken}`,
                "Content-Type": "application/json",
            },
            body: JSON.stringify(body),
        });
    
        if (!response.ok) {
            return {
                content: [
                    {
                        type: "text",
                        text: `Failed to update asset: ${response.statusText}`,
                    },
                ],
            };
        }
    
        const result = await response.json();
        
        return {
            content: [
                {
                    type: "text",
                    text: JSON.stringify(result),
                },
            ],
        };
    }
  • Zod input schema defining optional parameters for updating an asset, including asset_id (required).
        input: z.object({
            asset_id: z
                .number()
                .describe("ID of the asset to update"),
            type_name: z
                .enum([
                    "cash",
                    "credit",
                    "investment",
                    "real estate",
                    "loan",
                    "vehicle",
                    "cryptocurrency",
                    "employee compensation",
                    "other liability",
                    "other asset",
                ])
                .optional()
                .describe("Primary type of the asset"),
            subtype_name: z
                .string()
                .optional()
                .describe("Optional subtype (e.g., retirement, checking, savings)"),
            name: z
                .string()
                .optional()
                .describe("Name of the asset"),
            display_name: z
                .string()
                .optional()
                .describe("Display name of the asset"),
            balance: z
                .number()
                .optional()
                .describe("Current balance of the asset"),
            balance_as_of: z
                .string()
                .optional()
                .describe("Date/time the balance is as of in ISO 8601 format"),
            currency: z
                .string()
                .optional()
                .describe("Three-letter currency code"),
            institution_name: z
                .string()
                .optional()
                .describe("Name of the institution holding the asset"),
            closed_on: z
                .string()
                .optional()
                .describe("Date the asset was closed in YYYY-MM-DD format"),
            exclude_transactions: z
                .boolean()
                .optional()
                .describe("Whether to exclude this asset from transaction options"),
        }),
    },
  • MCP server.tool registration for the 'update_asset' tool, including description, schema, and handler.
    server.tool(
        "update_asset",
        "Update an existing manually-managed asset",
        {
            input: z.object({
                asset_id: z
                    .number()
                    .describe("ID of the asset to update"),
                type_name: z
                    .enum([
                        "cash",
                        "credit",
                        "investment",
                        "real estate",
                        "loan",
                        "vehicle",
                        "cryptocurrency",
                        "employee compensation",
                        "other liability",
                        "other asset",
                    ])
                    .optional()
                    .describe("Primary type of the asset"),
                subtype_name: z
                    .string()
                    .optional()
                    .describe("Optional subtype (e.g., retirement, checking, savings)"),
                name: z
                    .string()
                    .optional()
                    .describe("Name of the asset"),
                display_name: z
                    .string()
                    .optional()
                    .describe("Display name of the asset"),
                balance: z
                    .number()
                    .optional()
                    .describe("Current balance of the asset"),
                balance_as_of: z
                    .string()
                    .optional()
                    .describe("Date/time the balance is as of in ISO 8601 format"),
                currency: z
                    .string()
                    .optional()
                    .describe("Three-letter currency code"),
                institution_name: z
                    .string()
                    .optional()
                    .describe("Name of the institution holding the asset"),
                closed_on: z
                    .string()
                    .optional()
                    .describe("Date the asset was closed in YYYY-MM-DD format"),
                exclude_transactions: z
                    .boolean()
                    .optional()
                    .describe("Whether to exclude this asset from transaction options"),
            }),
        },
        async ({ input }) => {
            const { baseUrl, lunchmoneyApiToken } = getConfig();
            
            const body: any = {};
            
            if (input.type_name) body.type_name = input.type_name;
            if (input.subtype_name) body.subtype_name = input.subtype_name;
            if (input.name) body.name = input.name;
            if (input.display_name) body.display_name = input.display_name;
            if (input.balance !== undefined) body.balance = input.balance.toString();
            if (input.balance_as_of) body.balance_as_of = input.balance_as_of;
            if (input.currency) body.currency = input.currency;
            if (input.institution_name) body.institution_name = input.institution_name;
            if (input.closed_on) body.closed_on = input.closed_on;
            if (input.exclude_transactions !== undefined) body.exclude_transactions = input.exclude_transactions;
            
            const response = await fetch(`${baseUrl}/assets/${input.asset_id}`, {
                method: "PUT",
                headers: {
                    Authorization: `Bearer ${lunchmoneyApiToken}`,
                    "Content-Type": "application/json",
                },
                body: JSON.stringify(body),
            });
    
            if (!response.ok) {
                return {
                    content: [
                        {
                            type: "text",
                            text: `Failed to update asset: ${response.statusText}`,
                        },
                    ],
                };
            }
    
            const result = await response.json();
            
            return {
                content: [
                    {
                        type: "text",
                        text: JSON.stringify(result),
                    },
                ],
            };
        }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It indicates this is an update operation (implying mutation) but doesn't disclose permission requirements, whether changes are reversible, error conditions, or rate limits. This is inadequate for a mutation tool with zero annotation coverage.

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 a single, efficient sentence with no wasted words. It's appropriately sized for a basic tool description, though its brevity contributes to gaps in other dimensions.

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

Completeness2/5

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

For a mutation tool with 11 parameters, no annotations, and no output schema, the description is severely incomplete. It doesn't explain what 'update' entails, which fields are optional versus required beyond asset_id, or what the tool returns. The context demands much more detail than provided.

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

Parameters1/5

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

The description provides zero information about parameters beyond implying an 'asset' is involved. With 0% schema description coverage and 11 parameters (via nested object), the description fails to compensate for the schema's lack of parameter documentation, leaving all parameters semantically unexplained.

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

Purpose4/5

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

The description clearly states the action ('Update') and resource ('existing manually-managed asset'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'update_category' or 'update_manual_crypto', which also perform updates on different resources.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'create_asset' or 'get_all_assets'. It mentions 'manually-managed asset' but doesn't explain what qualifies as such or when to choose this over automated updates.

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