chase_accounts
Retrieves all Chase bank accounts including checking, savings, credit cards, investments, and loans for balance viewing and financial management.
Instructions
Get all Chase accounts - checking, savings, credit cards, investments, and loans.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:69-76 (registration)Tool registration in the tool list (ListToolsRequestSchema handler): defines the 'chase_accounts' tool name, description, and empty input schema.
name: "chase_accounts", description: "Get all Chase accounts - checking, savings, credit cards, investments, and loans.", inputSchema: { type: "object", properties: {}, }, }, - src/index.ts:281-292 (handler)Handler for the 'chase_accounts' tool in the CallToolRequestSchema switch statement. Delegates to getAccounts() from browser.ts and returns the result as JSON.
case "chase_accounts": { const result = await getAccounts(); return { content: [ { type: "text", text: JSON.stringify(result), }, ], isError: !result.success, }; } - src/browser.ts:172-217 (helper)The actual implementation of the account-fetching logic. Uses Patchright to navigate to the Chase dashboard, scrape account tiles (name, balance, type, last-four digits), and return them as Account objects.
export async function getAccounts(): Promise<{ success: boolean; accounts?: Account[]; error?: string }> { try { const p = await getPage(); await p.goto(`${CHASE_BASE_URL}/web/auth/dashboard`, { waitUntil: "networkidle" }); await p.waitForTimeout(2000); const accounts = await p.$$eval( '.account-tile, .account-card, [data-testid="account-tile"]', (elements) => elements.map((el, index) => { const nameEl = el.querySelector('.account-name, .tile-header, h3'); const balanceEl = el.querySelector('.account-balance, .balance, [data-testid="balance"]'); const lastFourEl = el.querySelector('.account-last-four, .masked-number'); const typeEl = el.querySelector('.account-type'); const name = nameEl?.textContent?.trim() || `Account ${index + 1}`; const balanceText = balanceEl?.textContent?.trim() || '0'; const balance = parseFloat(balanceText.replace(/[$,]/g, '')) || 0; const lastFour = lastFourEl?.textContent?.trim().replace(/[^0-9]/g, '').slice(-4) || undefined; let type: 'checking' | 'savings' | 'credit' | 'investment' | 'loan' = 'checking'; const typeText = (typeEl?.textContent || name).toLowerCase(); if (typeText.includes('saving')) type = 'savings'; else if (typeText.includes('credit') || typeText.includes('card')) type = 'credit'; else if (typeText.includes('invest') || typeText.includes('brokerage')) type = 'investment'; else if (typeText.includes('loan') || typeText.includes('mortgage') || typeText.includes('auto')) type = 'loan'; return { id: el.getAttribute('data-account-id') || `account-${index}`, name, type, balance, lastFour, }; }), ); return { success: true, accounts }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : "Failed to get accounts", }; } } - src/browser.ts:18-26 (schema)Type definition for the Account interface, which defines the structure returned by getAccounts().
export interface Account { id: string; name: string; type: "checking" | "savings" | "credit" | "investment" | "loan"; balance: number; availableBalance?: number; accountNumber?: string; lastFour?: string; }