Skip to main content
Glama
akutishevsky

LunchMoney MCP Server

create_asset

Add manually-managed assets like cash, investments, or loans to your LunchMoney financial tracking with current balances and categorization.

Instructions

Create a new manually-managed asset

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes

Implementation Reference

  • Handler that executes the tool by sending POST /assets to Lunchmoney API with input params as body.
    async ({ input }) => {
        const { baseUrl, lunchmoneyApiToken } = getConfig();
        
        const body: any = {
            type_name: input.type_name,
            name: input.name,
            balance: input.balance.toString(),
        };
        
        if (input.subtype_name) body.subtype_name = input.subtype_name;
        if (input.display_name) body.display_name = input.display_name;
        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`, {
            method: "POST",
            headers: {
                Authorization: `Bearer ${lunchmoneyApiToken}`,
                "Content-Type": "application/json",
            },
            body: JSON.stringify(body),
        });
    
        if (!response.ok) {
            return {
                content: [
                    {
                        type: "text",
                        text: `Failed to create asset: ${response.statusText}`,
                    },
                ],
            };
        }
    
        const result = await response.json();
        
        return {
            content: [
                {
                    type: "text",
                    text: JSON.stringify(result),
                },
            ],
        };
    }
  • Input schema using Zod for validating parameters required to create an asset.
    input: z.object({
        type_name: z
            .enum([
                "cash",
                "credit",
                "investment",
                "real estate",
                "loan",
                "vehicle",
                "cryptocurrency",
                "employee compensation",
                "other liability",
                "other asset",
            ])
            .describe("Primary type of the asset"),
        subtype_name: z
            .string()
            .optional()
            .describe("Optional subtype (e.g., retirement, checking, savings)"),
        name: z
            .string()
            .describe("Name of the asset"),
        display_name: z
            .string()
            .optional()
            .describe("Display name of the asset (defaults to name)"),
        balance: z
            .number()
            .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 (defaults to primary currency)"),
        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 call that registers the 'create_asset' tool with name, description, schema, and handler function.
    server.tool(
        "create_asset",
        "Create a new manually-managed asset",
        {
            input: z.object({
                type_name: z
                    .enum([
                        "cash",
                        "credit",
                        "investment",
                        "real estate",
                        "loan",
                        "vehicle",
                        "cryptocurrency",
                        "employee compensation",
                        "other liability",
                        "other asset",
                    ])
                    .describe("Primary type of the asset"),
                subtype_name: z
                    .string()
                    .optional()
                    .describe("Optional subtype (e.g., retirement, checking, savings)"),
                name: z
                    .string()
                    .describe("Name of the asset"),
                display_name: z
                    .string()
                    .optional()
                    .describe("Display name of the asset (defaults to name)"),
                balance: z
                    .number()
                    .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 (defaults to primary currency)"),
                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 = {
                type_name: input.type_name,
                name: input.name,
                balance: input.balance.toString(),
            };
            
            if (input.subtype_name) body.subtype_name = input.subtype_name;
            if (input.display_name) body.display_name = input.display_name;
            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`, {
                method: "POST",
                headers: {
                    Authorization: `Bearer ${lunchmoneyApiToken}`,
                    "Content-Type": "application/json",
                },
                body: JSON.stringify(body),
            });
    
            if (!response.ok) {
                return {
                    content: [
                        {
                            type: "text",
                            text: `Failed to create asset: ${response.statusText}`,
                        },
                    ],
                };
            }
    
            const result = await response.json();
            
            return {
                content: [
                    {
                        type: "text",
                        text: JSON.stringify(result),
                    },
                ],
            };
        }
    );
  • src/index.ts:29-29 (registration)
    Invocation of registerAssetTools in the main server setup, which includes registration of create_asset.
    registerAssetTools(server);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'Create a new manually-managed asset' which implies a write operation, but doesn't specify permissions required, whether this is idempotent, what happens on failure, or any rate limits. For a creation tool with zero annotation coverage, this leaves significant behavioral 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 extremely concise at just 4 words: 'Create a new manually-managed asset'. It's front-loaded with the core action and resource, with zero wasted words. Every element serves a purpose in this minimal statement.

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?

Given this is a creation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'manually-managed' means, what the tool returns, error conditions, or how it differs from other asset operations. For a tool that creates financial assets with 10 nested parameters, more context is needed beyond the basic action statement.

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?

The description has 0 parameters (it's a single 'input' object parameter), so the baseline is 4. While the description doesn't add any parameter details beyond the schema, the schema itself provides comprehensive documentation for all nested properties with 100% description coverage for the 'input' object's properties. The description doesn't need to compensate for parameter gaps.

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

Purpose3/5

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

The description states 'Create a new manually-managed asset' which clearly indicates a creation action for assets, but it's vague about what 'manually-managed' means and doesn't distinguish this from sibling tools like 'update_asset' or 'get_all_assets'. The verb 'create' is specific, but the resource scope lacks differentiation from related tools.

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?

No guidance is provided on when to use this tool versus alternatives like 'update_asset' or 'get_all_assets'. The description doesn't mention prerequisites, exclusions, or contextual triggers for creating an asset versus other asset-related operations. It's a basic statement of function without usage context.

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