Skip to main content
Glama
akutishevsky

LunchMoney MCP Server

get_recurring_items

Retrieve recurring financial items for a specified month to help forecast expected income and expenses.

Instructions

Retrieve a list of recurring items to expect for a specified month

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes

Implementation Reference

  • The handler function that fetches recurring items from the Lunchmoney API using the provided parameters.
    async ({ input }) => {
        const { baseUrl, lunchmoneyApiToken } = getConfig();
        
        const params = new URLSearchParams();
        if (input.start_date) params.append("start_date", input.start_date);
        if (input.end_date) params.append("end_date", input.end_date);
        if (input.debit_as_negative !== undefined) {
            params.append("debit_as_negative", input.debit_as_negative.toString());
        }
        
        const url = params.toString() 
            ? `${baseUrl}/recurring_items?${params}`
            : `${baseUrl}/recurring_items`;
            
        const response = await fetch(url, {
            headers: {
                Authorization: `Bearer ${lunchmoneyApiToken}`,
            },
        });
    
        if (!response.ok) {
            return {
                content: [
                    {
                        type: "text",
                        text: `Failed to get recurring items: ${response.statusText}`,
                    },
                ],
            };
        }
    
        const recurringItems: RecurringItem[] = await response.json();
        
        return {
            content: [
                {
                    type: "text",
                    text: JSON.stringify(recurringItems),
                },
            ],
        };
    }
  • Zod schema defining the input parameters for the get_recurring_items tool.
    input: z.object({
        start_date: z
            .string()
            .optional()
            .describe("Start date in YYYY-MM-DD format. Defaults to first day of current month"),
        end_date: z
            .string()
            .optional()
            .describe("End date in YYYY-MM-DD format"),
        debit_as_negative: z
            .boolean()
            .optional()
            .describe("Pass true to return debit amounts as negative"),
    }),
  • The registration function that calls server.tool() to register the get_recurring_items tool.
    export function registerRecurringItemsTools(server: McpServer) {
        server.tool(
            "get_recurring_items",
            "Retrieve a list of recurring items to expect for a specified month",
            {
                input: z.object({
                    start_date: z
                        .string()
                        .optional()
                        .describe("Start date in YYYY-MM-DD format. Defaults to first day of current month"),
                    end_date: z
                        .string()
                        .optional()
                        .describe("End date in YYYY-MM-DD format"),
                    debit_as_negative: z
                        .boolean()
                        .optional()
                        .describe("Pass true to return debit amounts as negative"),
                }),
            },
            async ({ input }) => {
                const { baseUrl, lunchmoneyApiToken } = getConfig();
                
                const params = new URLSearchParams();
                if (input.start_date) params.append("start_date", input.start_date);
                if (input.end_date) params.append("end_date", input.end_date);
                if (input.debit_as_negative !== undefined) {
                    params.append("debit_as_negative", input.debit_as_negative.toString());
                }
                
                const url = params.toString() 
                    ? `${baseUrl}/recurring_items?${params}`
                    : `${baseUrl}/recurring_items`;
                    
                const response = await fetch(url, {
                    headers: {
                        Authorization: `Bearer ${lunchmoneyApiToken}`,
                    },
                });
    
                if (!response.ok) {
                    return {
                        content: [
                            {
                                type: "text",
                                text: `Failed to get recurring items: ${response.statusText}`,
                            },
                        ],
                    };
                }
    
                const recurringItems: RecurringItem[] = await response.json();
                
                return {
                    content: [
                        {
                            type: "text",
                            text: JSON.stringify(recurringItems),
                        },
                    ],
                };
            }
        );
    }
  • src/index.ts:27-27 (registration)
    Top-level call to register the recurring items tools on the MCP server.
    registerRecurringItemsTools(server);
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 lacks behavioral details. It doesn't disclose whether this is a read-only operation, what permissions are needed, how results are formatted, or any rate limits. The phrase 'to expect' hints at predictive data but doesn't clarify behavior.

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 redundancy. It's front-loaded with the main action and resource, making it easy to parse quickly.

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 tool with 1 parameter (nested object with 3 sub-parameters), 0% schema coverage, no annotations, and no output schema, the description is insufficient. It doesn't explain what 'recurring items' are in this context, how results are returned, or provide enough detail for reliable agent use.

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?

The description mentions 'for a specified month' which loosely relates to the start_date and end_date parameters, but with 0% schema description coverage, it doesn't explain the 'debit_as_negative' parameter or date format specifics. It adds minimal value beyond the schema's structural information.

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 ('retrieve a list') and resource ('recurring items') with temporal scope ('for a specified month'). It distinguishes from siblings like 'get_transactions' or 'get_all_categories' by focusing specifically on recurring items, though it doesn't explicitly contrast with them.

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 'get_transactions' or 'get_budget_summary' for similar data. It mentions 'for a specified month' but doesn't clarify prerequisites, exclusions, or comparative use cases with sibling tools.

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