Skip to main content
Glama

mirror_query_account

Retrieve Hedera account details including balance, creation time, keys, and transaction history using the Mirror Node REST API without transaction fees.

Instructions

Query comprehensive account data from Hedera Mirror Node REST API.

RETURNS: Balance, EVM address, creation time, keys, memo, transactions (optional) FREE: No transaction fees (REST API query)

USE FOR: Account inspection, transaction history, state verification.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountIdYesAccount ID (0.0.xxxxx)
includeTransactionsNoInclude recent transactions
transactionLimitNoTransaction count (default: 20)

Implementation Reference

  • Core handler function that executes the mirror_query_account tool logic by querying the Hedera Mirror Node for account details including balance, keys, staking info, etc.
    export async function mirrorQueryAccount(args: { accountId: string; timestamp?: string; }): Promise<ToolResult> { try { logger.info('Querying account from Mirror Node', { accountId: args.accountId }); const account = await mirrorNodeService.getAccount(args.accountId, { timestamp: args.timestamp, }); return { success: true, data: { accountId: account.account, evmAddress: account.evm_address, balance: { hbar: account.balance.balance / 100_000_000, // Convert tinybar to HBAR tokens: account.balance.tokens, }, alias: account.alias, memo: account.memo, createdTimestamp: account.created_timestamp, expiryTimestamp: account.expiry_timestamp, autoRenewPeriod: account.auto_renew_period, deleted: account.deleted, ethereumNonce: account.ethereum_nonce, maxAutoTokenAssociations: account.max_automatic_token_associations, stakedNodeId: account.staked_node_id, stakedAccountId: account.staked_account_id, pendingReward: account.pending_reward, declineReward: account.decline_reward, key: account.key, }, metadata: { network: mirrorNodeService.getCurrentNetwork(), executedVia: 'mirror_node_rest_api', }, }; } catch (error) { logger.error('Failed to query account', { error }); return { success: false, error: error instanceof Error ? error.message : 'Unknown error', metadata: { network: mirrorNodeService.getCurrentNetwork(), }, }; } }
  • Input schema definition for the mirror_query_account tool as registered in the MCP server's tool list.
    { name: 'mirror_query_account', description: `Query comprehensive account data from Hedera Mirror Node REST API. RETURNS: Balance, EVM address, creation time, keys, memo, transactions (optional) FREE: No transaction fees (REST API query) USE FOR: Account inspection, transaction history, state verification.`, inputSchema: { type: 'object' as const, properties: { accountId: { type: 'string', description: 'Account ID (0.0.xxxxx)' }, includeTransactions: { type: 'boolean', description: 'Include recent transactions' }, transactionLimit: { type: 'number', description: 'Transaction count (default: 20)' }, }, required: ['accountId'], }, },
  • src/index.ts:642-644 (registration)
    Registration and dispatch logic in the MCP server's tool execution switch statement.
    case 'mirror_query_account': result = await mirrorQueryAccount(args as any); break;
  • Detailed input schema matching the handler function parameters in mirrorNodeTools export.
    { name: 'mirror_query_account', description: 'Get comprehensive account information from Hedera Mirror Node REST API. Returns balance, EVM address, keys, memo, staking info, and more. No API key required.', inputSchema: { type: 'object' as const, properties: { accountId: { type: 'string', description: 'Hedera account ID (format: 0.0.xxxxx), alias, or EVM address', }, timestamp: { type: 'string', description: 'Optional: Query account state at specific timestamp', }, }, required: ['accountId'], }, },
  • src/index.ts:61-61 (registration)
    Import statement registering the handler function into the main MCP server index.
    import { mirrorQueryAccount } from './tools/mirror-node.js';

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/justmert/hashpilot'

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