Skip to main content
Glama
akutishevsky

LunchMoney MCP Server

trigger_plaid_fetch

Fetch the latest financial data from Plaid to update transaction records and account balances in LunchMoney. This experimental process may take up to 5 minutes to complete.

Instructions

Trigger a fetch of latest data from Plaid (Experimental). Note that fetching may take up to 5 minutes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The asynchronous handler function for the 'trigger_plaid_fetch' tool. It sends a POST request to the LunchMoney API endpoint '/plaid_accounts/fetch' to trigger fetching the latest data from Plaid accounts. Returns a success or error message in MCP content format.
    async () => {
        const { baseUrl, lunchmoneyApiToken } = getConfig();
        
        const response = await fetch(`${baseUrl}/plaid_accounts/fetch`, {
            method: "POST",
            headers: {
                Authorization: `Bearer ${lunchmoneyApiToken}`,
            },
        });
    
        if (!response.ok) {
            return {
                content: [
                    {
                        type: "text",
                        text: `Failed to trigger Plaid fetch: ${response.statusText}`,
                    },
                ],
            };
        }
    
        return {
            content: [
                {
                    type: "text",
                    text: "Plaid fetch triggered successfully. Fetching may take up to 5 minutes.",
                },
            ],
        };
    }
  • The server.tool registration for 'trigger_plaid_fetch', including the tool name, description, empty input schema, and the handler function. This is called within the registerPlaidAccountTools function.
    server.tool(
        "trigger_plaid_fetch",
        "Trigger a fetch of latest data from Plaid (Experimental). Note that fetching may take up to 5 minutes.",
        {},
        async () => {
            const { baseUrl, lunchmoneyApiToken } = getConfig();
            
            const response = await fetch(`${baseUrl}/plaid_accounts/fetch`, {
                method: "POST",
                headers: {
                    Authorization: `Bearer ${lunchmoneyApiToken}`,
                },
            });
    
            if (!response.ok) {
                return {
                    content: [
                        {
                            type: "text",
                            text: `Failed to trigger Plaid fetch: ${response.statusText}`,
                        },
                    ],
                };
            }
    
            return {
                content: [
                    {
                        type: "text",
                        text: "Plaid fetch triggered successfully. Fetching may take up to 5 minutes.",
                    },
                ],
            };
        }
    );
  • src/index.ts:30-30 (registration)
    Top-level call to registerPlaidAccountTools(server), which in turn registers the 'trigger_plaid_fetch' tool among others.
    registerPlaidAccountTools(server);

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