get_account_balance
Retrieve the current balance for a specific financial account by providing the account ID, enabling users to check their account status within Monarch Money.
Instructions
Get the current balance for a specific account
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accountId | Yes | The ID of the account |
Implementation Reference
- src/tools.ts:265-291 (handler)The actual implementation of getAccountBalance that retrieves account details including current balance, account name, type, and institution from the Monarch Money APIprivate async getAccountBalance(accountId: string): Promise<any> { try { const accounts = await this.api.getAccounts(); const account = accounts?.find((acc: Account) => acc.id === accountId); if (!account) { throw new Error(`Account with ID ${accountId} not found`); } return { success: true, data: { accountId: account.id, accountName: account.displayName, currentBalance: account.currentBalance, accountType: account.type?.name, institutionName: account.institution?.name, }, }; } catch (error) { throw new Error( `Failed to get account balance: ${ error instanceof Error ? error.message : 'Unknown error' }` ); } }
- src/tools.ts:22-35 (schema)Tool definition with schema registration - defines the tool name, description, and input validation (requires accountId as a string){ name: 'get_account_balance', description: 'Get the current balance for a specific account', inputSchema: { type: 'object', properties: { accountId: { type: 'string', description: 'The ID of the account', }, }, required: ['accountId'], }, },
- src/tools.ts:209-210 (registration)Tool routing registration that maps the 'get_account_balance' tool name to its handler methodcase 'get_account_balance': return await this.getAccountBalance(args.accountId);