get_all_plaid_accounts
Retrieve all Plaid-linked financial accounts to access transaction data and account balances for personal finance management.
Instructions
Get a list of all Plaid accounts associated with the user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/plaid-accounts.ts:10-41 (handler)The core handler logic for the 'get_all_plaid_accounts' tool. It fetches the Plaid accounts from the LunchMoney API using the configured baseUrl and API token, parses the response, and returns the accounts as a JSON string in the tool's content block, or an error message if the request fails.async () => { const { baseUrl, lunchmoneyApiToken } = getConfig(); const response = await fetch(`${baseUrl}/plaid_accounts`, { headers: { Authorization: `Bearer ${lunchmoneyApiToken}`, }, }); if (!response.ok) { return { content: [ { type: "text", text: `Failed to get Plaid accounts: ${response.statusText}`, }, ], }; } const data = await response.json(); const plaidAccounts: PlaidAccount[] = data.plaid_accounts; return { content: [ { type: "text", text: JSON.stringify(plaidAccounts), }, ], }; }
- src/tools/plaid-accounts.ts:6-42 (registration)Registers the 'get_all_plaid_accounts' tool on the MCP server with its name, description, empty input schema ({}), and inline handler function.server.tool( "get_all_plaid_accounts", "Get a list of all Plaid accounts associated with the user", {}, async () => { const { baseUrl, lunchmoneyApiToken } = getConfig(); const response = await fetch(`${baseUrl}/plaid_accounts`, { headers: { Authorization: `Bearer ${lunchmoneyApiToken}`, }, }); if (!response.ok) { return { content: [ { type: "text", text: `Failed to get Plaid accounts: ${response.statusText}`, }, ], }; } const data = await response.json(); const plaidAccounts: PlaidAccount[] = data.plaid_accounts; return { content: [ { type: "text", text: JSON.stringify(plaidAccounts), }, ], }; } );
- src/index.ts:30-30 (registration)Top-level invocation of the registerPlaidAccountTools function, which registers the 'get_all_plaid_accounts' tool (among others) on the main MCP server instance.registerPlaidAccountTools(server);