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';
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It adds useful context: 'FREE: No transaction fees (REST API query)' clarifies cost implications, and 'RETURNS: Balance, EVM address, creation time, keys, memo, transactions (optional)' outlines output behavior. However, it doesn't cover other key traits like rate limits, authentication needs, error handling, or pagination details, leaving gaps for a mutation-free query tool.

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

Conciseness5/5

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

The description is well-structured and front-loaded, starting with the core purpose. Each sentence adds value: the first states the action, the second lists returns, the third clarifies cost, and the fourth provides usage guidelines. There's no wasted text, and it's appropriately sized for the tool's complexity.

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

Completeness3/5

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

Given no annotations and no output schema, the description partially compensates by listing return values and cost details. However, for a query tool with 3 parameters and no structured output, it lacks information on response format (e.g., JSON structure), error cases, or limitations like rate limits. This makes it adequate but incomplete for full agent understanding.

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?

Schema description coverage is 100%, so the schema already documents all parameters (accountId, includeTransactions, transactionLimit) with descriptions. The description doesn't add any parameter-specific semantics beyond what's in the schema, such as format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 the tool's purpose: 'Query comprehensive account data from Hedera Mirror Node REST API.' It specifies the verb ('query'), resource ('account data'), and source ('Hedera Mirror Node REST API'), making the action distinct. However, it doesn't explicitly differentiate from siblings like 'account_balance' or 'account_info', which might offer overlapping functionality, so it doesn't reach a perfect score.

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

Usage Guidelines4/5

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

The description provides clear usage context with 'USE FOR: Account inspection, transaction history, state verification.' This gives practical scenarios for when to use the tool. However, it doesn't specify when not to use it or name alternatives (e.g., 'account_balance' for just balances), so it lacks explicit exclusions or sibling comparisons.

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

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