Skip to main content
Glama
akutishevsky

LunchMoney MCP Server

get_all_categories

Retrieve a comprehensive list of all financial categories from your LunchMoney account, available in flattened alphabetical order or nested hierarchical format for better organization.

Instructions

Get a flattened list of all categories in alphabetical order associated with the user's account.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes

Implementation Reference

  • The handler function for the get_all_categories tool. It fetches categories from the Lunchmoney API endpoint `/categories` with optional format parameter, handles errors, and returns JSON stringified categories.
    async ({ input }) => {
        const format = input.format || "flattened";
        const { baseUrl, lunchmoneyApiToken } = getConfig();
        const response = await fetch(`${baseUrl}/categories?format=${format}`, {
            headers: {
                Authorization: `Bearer ${lunchmoneyApiToken}`,
            },
        });
    
        if (!response.ok) {
            return {
                content: [
                    {
                        type: "text",
                        text: `Failed to get all categories: ${response.statusText}`,
                    },
                ],
            };
        }
    
        const categories: Category[] = await response.json();
        
        return {
            content: [
                {
                    type: "text",
                    text: JSON.stringify(categories),
                },
            ],
        };
    }
  • The input schema for the get_all_categories tool, defining an optional 'format' parameter using Zod.
    input: z.object({
        format: z
            .string()
            .optional()
            .describe(
                "Can either flattened or nested. If flattened, returns a singular array of categories, ordered alphabetically. If nested, returns top-level categories (either category groups or categories not part of a category group) in an array. Subcategories are nested within the category group under the property children."
            ),
    }),
  • The registration of the get_all_categories tool within the registerCategoryTools function using server.tool().
    server.tool(
        "get_all_categories",
        "Get a flattened list of all categories in alphabetical order associated with the user's account.",
        {
            input: z.object({
                format: z
                    .string()
                    .optional()
                    .describe(
                        "Can either flattened or nested. If flattened, returns a singular array of categories, ordered alphabetically. If nested, returns top-level categories (either category groups or categories not part of a category group) in an array. Subcategories are nested within the category group under the property children."
                    ),
            }),
        },
        async ({ input }) => {
            const format = input.format || "flattened";
            const { baseUrl, lunchmoneyApiToken } = getConfig();
            const response = await fetch(`${baseUrl}/categories?format=${format}`, {
                headers: {
                    Authorization: `Bearer ${lunchmoneyApiToken}`,
                },
            });
    
            if (!response.ok) {
                return {
                    content: [
                        {
                            type: "text",
                            text: `Failed to get all categories: ${response.statusText}`,
                        },
                    ],
                };
            }
    
            const categories: Category[] = await response.json();
            
            return {
                content: [
                    {
                        type: "text",
                        text: JSON.stringify(categories),
                    },
                ],
            };
        }
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the output is 'flattened' and 'in alphabetical order', which adds some context beyond the basic 'get' action. However, it doesn't address critical behaviors like whether this is a read-only operation (implied but not stated), potential rate limits, authentication requirements, error conditions, or the response format (e.g., JSON structure). For a tool with no annotation coverage, this leaves significant 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 a single, well-structured sentence that efficiently conveys the core purpose without unnecessary words. It's front-loaded with the main action and resource, making it easy to parse. Every part of the sentence earns its place by adding specific details like 'flattened', 'alphabetical order', and 'user's account'.

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 the tool's low complexity (1 parameter, no annotations, no output schema), the description is minimally adequate. It covers the basic purpose and output characteristics but lacks details on usage guidelines, behavioral traits (e.g., safety, errors), and explicit parameter documentation. For a simple read operation, this might suffice, but it doesn't provide a complete picture for an agent to use the tool confidently without additional inference.

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 input schema has 1 parameter with 0% description coverage, so the schema provides no parameter details. The description compensates by specifying that the output is 'flattened' and 'in alphabetical order', which indirectly relates to the 'format' parameter (as the schema describes 'flattened' vs. 'nested' options). However, it doesn't explicitly mention the parameter or its options, leaving some ambiguity. Given the low schema coverage, the description adds meaningful context but falls short of fully documenting the parameter.

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 action ('Get'), the resource ('a flattened list of all categories'), and the scope ('associated with the user's account'). It distinguishes from siblings like 'get_single_category' (which retrieves one category) and 'get_all_tags' (which retrieves tags instead of categories). The verb+resource+scope combination is specific and unambiguous.

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. It doesn't mention sibling tools like 'get_single_category' for retrieving a specific category or 'get_all_tags' for a different resource type. There's no context about prerequisites, such as whether the user must be authenticated or have categories set up, leaving the agent to infer usage from the tool name alone.

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