Skip to main content
Glama

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
NameRequiredDescriptionDefault
accountIdYesAccount ID (format: 0.0.xxxxx)

Implementation Reference

  • 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',
        };
      }
    }
  • 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;
      }
    }
  • 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'],
      },
    },
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively adds context beyond basic functionality: it specifies what information is returned (balance, EVM address, etc.), notes it's a Mirror Node query (implying read-only, non-destructive), and explicitly states 'FREE: No transaction fee,' which is crucial for cost-awareness. However, it doesn't mention rate limits, authentication needs, or error handling, leaving some behavioral aspects uncovered.

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 efficiently structured with clear sections (purpose, returns, cost, usage) in just four sentences. Each sentence earns its place by providing distinct value: the first states the core action, the second details returns, the third clarifies cost, and the fourth offers usage guidelines. It's front-loaded with the main purpose and avoids any redundant or vague phrasing.

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

Completeness4/5

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

Given the tool's moderate complexity (a read-only query with one parameter), no annotations, and no output schema, the description does well by covering key aspects: purpose, returns, cost, and usage. However, it lacks details on output format (e.g., JSON structure) and potential errors, which could be important for an AI agent to handle responses correctly, slightly reducing completeness.

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 has 100% description coverage, with the single parameter 'accountId' well-documented in the schema itself ('Account ID (format: 0.0.xxxxx)'). The description adds no additional parameter semantics beyond what the schema provides, such as examples or edge cases, so it meets the baseline of 3 for high schema coverage without compensating value.

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

Purpose5/5

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

The description clearly states the specific action ('Get comprehensive Hedera account information') and resource ('Hedera account'), distinguishing it from siblings like 'account_balance' (which only returns balance) and 'account_create' (which creates accounts). The verb 'Get' is precise and the scope 'comprehensive' sets expectations appropriately.

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

Usage Guidelines5/5

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

The description explicitly provides usage guidance with 'USE FOR: Account inspection, EVM address lookup, key verification, expiration monitoring.' This gives clear scenarios when to use this tool versus alternatives like 'account_balance' for just balance or 'mirror_query_account' for similar queries, making it highly actionable for an AI agent.

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