Skip to main content
Glama

chase_balance

Retrieve the current balance for a Chase account by entering the account ID. Returns the account's available balance.

Instructions

Get the current balance for a specific account.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountIdYesThe account ID to check balance for

Implementation Reference

  • The actual getBalance handler function that fetches the account balance by finding the account from getAccounts() result.
    export async function getBalance(accountId: string): Promise<{ success: boolean; balance?: number; availableBalance?: number; error?: string }> {
      try {
        const accountsResult = await getAccounts();
        if (!accountsResult.success || !accountsResult.accounts) {
          return { success: false, error: "Failed to get accounts" };
        }
        
        const account = accountsResult.accounts.find(a => a.id === accountId);
        if (!account) {
          return { success: false, error: `Account not found: ${accountId}` };
        }
        
        return {
          success: true,
          balance: account.balance,
          availableBalance: account.availableBalance || account.balance,
        };
      } catch (error) {
        return {
          success: false,
          error: error instanceof Error ? error.message : "Failed to get balance",
        };
      }
    }
  • Tool registration definition including input schema for chase_balance, requiring an 'accountId' string parameter.
    {
      name: "chase_balance",
      description:
        "Get the current balance for a specific account.",
      inputSchema: {
        type: "object",
        properties: {
          accountId: {
            type: "string",
            description: "The account ID to check balance for",
          },
        },
        required: ["accountId"],
      },
    },
  • src/index.ts:294-306 (registration)
    The tool execution handler that dispatches the 'chase_balance' tool call to the getBalance function from browser.ts.
    case "chase_balance": {
      const { accountId } = args as { accountId: string };
      const result = await getBalance(accountId);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(result),
          },
        ],
        isError: !result.success,
      };
    }
  • The getAccounts() helper function that getBalance depends on to find the account and its balance.
    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",
        };
      }
    }
  • Import of the getBalance function from browser.ts module.
    import {
      checkAuth,
      getAccounts,
      getTransactions,
      getBalance,
      getBills,
      getTransfers,
      getStatements,
      getRewards,
      initiateTransfer,
      payBill,
      getLoginUrl,
      cleanup,
    } from "./browser.js";
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description must cover behavioral traits. It does not state that the operation is read-only, nor does it mention auth requirements, error handling, or what happens if accountId is invalid. This is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence with no wasted words. It is front-loaded and easy to parse, though it could be slightly more informative without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and no annotations, the description should provide more context, such as the return format (e.g., numeric, string) or prerequisites (e.g., need accountId from chase_accounts). It feels incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides a description for the single parameter (accountId). The tool description adds no additional meaning beyond the schema, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Get the current balance for a specific account', which specifies a verb and resource. However, it does not differentiate between balance types (e.g., available vs ledger), slightly reducing specificity. It distinguishes from siblings like chase_transactions or chase_accounts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus siblings such as chase_accounts (which might list account details) or chase_transactions. The description gives no context for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/markswendsen-code/mcp-chase'

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