Skip to main content
Glama
elcukro

bank-mcp

by elcukro

list_accounts

Retrieve all bank accounts with UIDs, IBANs, names, and currencies from configured financial connections using the bank-mcp server.

Instructions

List all bank accounts across configured connections. Returns account UIDs, IBANs, names, and currencies.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionIdNoConnection ID to query. If omitted, queries all connections.

Implementation Reference

  • Main handler function that executes the list_accounts tool logic - retrieves connections, calls provider.listAccounts(), and returns tagged account list with caching support
    export async function listAccounts( args: z.infer<typeof listAccountsSchema>, ): Promise<BankAccount[]> { const config = loadConfig(); const connections = args.connectionId ? [getConnection(config, args.connectionId)] : getAllConnections(config); const allAccounts: BankAccount[] = []; for (const conn of connections) { const cacheKey = `accounts:${conn.id}`; const cached = cache.get<BankAccount[]>(cacheKey); if (cached) { allAccounts.push(...cached); continue; } const provider = getProvider(conn.provider); const accounts = await provider.listAccounts(conn.config); // Tag each account with its connection const tagged = accounts.map((a) => ({ ...a, connectionId: conn.id })); cache.set(cacheKey, tagged, TTL.ACCOUNTS); allAccounts.push(...tagged); } return allAccounts; }
  • Zod schema defining the input validation for list_accounts tool - optional connectionId parameter
    export const listAccountsSchema = z.object({ connectionId: z .string() .optional() .describe("Connection ID to query. If omitted, queries all connections."), });
  • src/server.ts:25-30 (registration)
    Tool registration in the TOOLS array with name, description, and schema
    { name: "list_accounts", description: "List all bank accounts across configured connections. Returns account UIDs, IBANs, names, and currencies.", inputSchema: z.toJSONSchema(listAccountsSchema), },
  • src/server.ts:59-68 (registration)
    Handler registration mapping the list_accounts tool name to the handler function with schema validation
    const handlers: Record<string, ToolHandler> = { list_accounts: (args) => listAccounts(listAccountsSchema.parse(args)), list_transactions: (args) => listTransactions(listTransactionsSchema.parse(args)), search_transactions: (args) => searchTransactions(searchTransactionsSchema.parse(args)), get_balance: (args) => getBalance(getBalanceSchema.parse(args)), spending_summary: (args) => spendingSummary(spendingSummarySchema.parse(args)), };
  • Abstract method in BankProvider base class that all provider implementations must override to fetch accounts
    /** Fetch all accounts accessible via this connection. */ abstract listAccounts( config: Record<string, unknown>, ): Promise<BankAccount[]>;

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/elcukro/bank-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server