account_info
Retrieve Hedera account details including balance, EVM address, public key, and expiration data for account inspection and verification without transaction fees.
Instructions
Get comprehensive Hedera account information.
RETURNS: Balance, EVM address, public key, memo, auto-renew period, expiration FREE: No transaction fee (Mirror Node query)
USE FOR: Account inspection, EVM address lookup, key verification, expiration monitoring.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accountId | Yes | Account ID (format: 0.0.xxxxx) |
Implementation Reference
- src/tools/account.ts:39-58 (handler)The primary handler function that executes the 'account_info' tool logic by calling the Hedera CLI command 'account info'.export async function getAccountInfo(args: { accountId: string }): Promise<ToolResult> { try { logger.info('Getting account info', { accountId: args.accountId }); const result = await hederaCLI.executeCommand({ command: 'account info', args: { accountId: args.accountId, }, }); return result; } catch (error) { logger.error('Failed to get account info', { error }); return { success: false, error: error instanceof Error ? error.message : 'Unknown error', }; } }
- src/index.ts:151-165 (schema)The input schema and metadata definition for the 'account_info' tool used by the MCP server for validation and tool listing.name: 'account_info', description: `Get comprehensive Hedera account information. RETURNS: Balance, EVM address, public key, memo, auto-renew period, expiration FREE: No transaction fee (Mirror Node query) USE FOR: Account inspection, EVM address lookup, key verification, expiration monitoring.`, inputSchema: { type: 'object' as const, properties: { accountId: { type: 'string', description: 'Account ID (format: 0.0.xxxxx)' }, }, required: ['accountId'], }, },
- src/index.ts:572-574 (registration)Tool registration and dispatch logic in the main MCP tool execution handler switch statement.case 'account_info': result = await getAccountInfo(args as { accountId: string }); break;
- Supporting service method in HederaClientService that queries detailed account information using the Hedera SDK's AccountInfoQuery.async getAccountInfo(accountId: string): Promise<{ accountId: string; balance: string; evmAddress: string | null; key: string; memo: string; autoRenewPeriod: number; expirationTime: Date; }> { try { const client = this.getClient(); const info = await new AccountInfoQuery() .setAccountId(AccountId.fromString(accountId)) .execute(client); return { accountId: info.accountId.toString(), balance: info.balance.toString(), evmAddress: info.contractAccountId || null, key: info.key.toString(), memo: info.accountMemo, autoRenewPeriod: info.autoRenewPeriod?.seconds?.toNumber() || 0, expirationTime: info.expirationTime ? new Date(info.expirationTime.seconds.toNumber() * 1000) : new Date(), }; } catch (error) { logger.error('Failed to get account info', { accountId, error }); throw error; } }
- src/tools/account.ts:368-382 (schema)Alternative/local schema definition for the 'account_info' tool within the accountTools export array.name: 'account_info', description: 'Get comprehensive information about a Hedera account including balance, EVM address, keys, memo, and expiration details.', inputSchema: { type: 'object' as const, properties: { accountId: { type: 'string', description: 'Hedera account ID (format: 0.0.xxxxx)', pattern: '^0\\.0\\.\\d+$', }, }, required: ['accountId'], }, },