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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/plaid-accounts.ts:48-77 (handler)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.", }, ], }; }
- src/tools/plaid-accounts.ts:44-78 (registration)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);