Skip to main content
Glama
akutishevsky

LunchMoney MCP Server

get_single_category

Retrieve detailed information for a specific financial category in LunchMoney, including inherited properties from category groups when applicable.

Instructions

Get hydrated details on a single category. Note that if this category is part of a category group, its properties (is_income, exclude_from_budget, exclude_from_totals) will inherit from the category group.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes

Implementation Reference

  • Handler function that executes the tool: fetches category details from Lunchmoney API by ID and returns JSON.
    async ({ input }) => {
        const { categoryId } = input;
        const { baseUrl, lunchmoneyApiToken } = getConfig();
        const response = await fetch(`${baseUrl}/categories/${categoryId}`, {
            headers: {
                Authorization: `Bearer ${lunchmoneyApiToken}`,
            },
        });
    
        if (!response.ok) {
            return {
                content: [
                    {
                        type: "text",
                        text: `Failed to get single category: ${response.statusText}`,
                    },
                ],
            };
        }
    
        const category: Category = await response.json();
        
        return {
            content: [
                {
                    type: "text",
                    text: JSON.stringify(category),
                },
            ],
        };
    }
  • Zod input schema requiring a categoryId string.
        input: z.object({
            categoryId: z
                .string()
                .describe(
                    "Id of the category to query. Should call the get_all_categories tool first to get the ids."
                ),
        }),
    },
  • Registration of the get_single_category tool using server.tool(), including name, description, schema, and handler.
    server.tool(
        "get_single_category",
        "Get hydrated details on a single category. Note that if this category is part of a category group, its properties (is_income, exclude_from_budget, exclude_from_totals) will inherit from the category group.",
        {
            input: z.object({
                categoryId: z
                    .string()
                    .describe(
                        "Id of the category to query. Should call the get_all_categories tool first to get the ids."
                    ),
            }),
        },
        async ({ input }) => {
            const { categoryId } = input;
            const { baseUrl, lunchmoneyApiToken } = getConfig();
            const response = await fetch(`${baseUrl}/categories/${categoryId}`, {
                headers: {
                    Authorization: `Bearer ${lunchmoneyApiToken}`,
                },
            });
    
            if (!response.ok) {
                return {
                    content: [
                        {
                            type: "text",
                            text: `Failed to get single category: ${response.statusText}`,
                        },
                    ],
                };
            }
    
            const category: Category = await response.json();
            
            return {
                content: [
                    {
                        type: "text",
                        text: JSON.stringify(category),
                    },
                ],
            };
        }
    );
  • src/index.ts:24-24 (registration)
    Top-level call to register all category tools, including get_single_category.
    registerCategoryTools(server);
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that category properties may inherit from a parent group, which is useful behavioral context beyond basic retrieval. However, it doesn't cover other traits like error handling, authentication needs, rate limits, or response format, leaving gaps for a tool with mutation siblings.

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 sentences with zero waste: the first states the core purpose, and the second adds critical behavioral nuance about inheritance. It's front-loaded and appropriately sized, with every sentence earning its place by enhancing understanding.

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

Completeness3/5

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

Given no annotations and no output schema, the description is moderately complete for a read-only tool. It covers the purpose and a key behavioral trait (inheritance), but lacks details on return values, error cases, or how it fits into broader workflows with siblings like 'update_category', leaving room for improvement in contextual richness.

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 adds no parameter details beyond the schema, but with 0% schema description coverage, it doesn't need to compensate heavily. The single parameter 'categoryId' is straightforward, and the description's reference to 'get_all_categories' for IDs provides practical guidance, earning a baseline above 3 due to minimal parameter complexity.

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 ('Get hydrated details') and resource ('on a single category'), making the purpose evident. It distinguishes from sibling 'get_all_categories' by specifying a single category, though it doesn't explicitly contrast with other siblings like 'get_budget_summary' or 'get_user'.

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

Usage Guidelines3/5

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

The description implies usage by referencing 'get_all_categories' to obtain IDs, providing some context for when to use this tool. However, it lacks explicit guidance on when to choose this over alternatives like 'get_all_categories' for bulk data or other get_* tools for different resources, and doesn't mention prerequisites or exclusions.

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