Skip to main content
Glama

identity_resolve

Resolve Hedera account IDs to view on-chain identity profiles including account age, token holdings, transaction history, and HCS-based identity records.

Instructions

Resolve a Hedera account ID to its on-chain identity profile including account age, token holdings, transaction history, and any HCS-based identity records. Costs 0.1 HBAR.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyYesYour HederaIntel API key
account_idYesHedera account ID to resolve (e.g. 0.0.123456)

Implementation Reference

  • The core handler logic for "identity_resolve" which fetches account details, token holdings, transactions, and calculates account age and risks.
    // --- identity_resolve ---
    if (name === "identity_resolve") {
      const payment = chargeForTool("identity_resolve", args.api_key);
      const base = getMirrorNodeBase();
    
      // Resolve EVM address or Hedera ID
      const resolved = await resolveAccountInput(args.account_id, base);
      const hederaId = resolved.hederaId;
    
      // Use cached account data if available from resolution
      const account = resolved._account ||
        (await axios.get(`${base}/api/v1/accounts/${hederaId}`)).data;
    
      // Fetch token balances
      const tokenRes = await axios.get(
        `${base}/api/v1/accounts/${hederaId}/tokens?limit=50&order=desc`
      ).catch(() => ({ data: { tokens: [] } }));
      const tokens = tokenRes.data.tokens || [];
    
      // Fetch recent transactions
      const txRes = await axios.get(
        `${base}/api/v1/transactions?account.id=${hederaId}&limit=25&order=desc`
      ).catch(() => ({ data: { transactions: [] } }));
      const transactions = txRes.data.transactions || [];
    
      // Fetch NFT holdings
      const nftRes = await axios.get(
        `${base}/api/v1/accounts/${hederaId}/nfts?limit=25&order=desc`
      ).catch(() => ({ data: { nfts: [] } }));
      const nfts = nftRes.data.nfts || [];
    
      // Calculate account age
      const createdAt = account.created_timestamp
        ? new Date(parseFloat(account.created_timestamp) * 1000)
        : null;
      const ageMs = createdAt ? Date.now() - createdAt.getTime() : null;
      const ageDays = ageMs ? Math.floor(ageMs / (1000 * 60 * 60 * 24)) : null;
    
      // Transaction type breakdown
      const txTypes = {};
      for (const tx of transactions) {
        const t = tx.name || "UNKNOWN";
        txTypes[t] = (txTypes[t] || 0) + 1;
      }
    
      // Staking info
      const stakingInfo = account.staked_node_id !== null && account.staked_node_id !== undefined
        ? { staked_node: account.staked_node_id, staked_account: account.staked_account_id || null }
        : null;
    
      return {
        account_id: hederaId,
        input: args.account_id,
        input_type: resolved.inputType,
        alias: account.alias || null,
        evm_address: resolved.evmAddress || account.evm_address || null,
        hbar_balance: account.balance?.balance
          ? (account.balance.balance / 100000000).toFixed(4) + " HBAR"
          : "unknown",
        account_age_days: ageDays,
        created_at: createdAt ? createdAt.toISOString() : null,
        memo: account.memo || null,
        receiver_sig_required: account.receiver_sig_required || false,
        max_auto_token_associations: account.max_automatic_token_associations || 0,
        token_count: tokens.length,
        nft_count: nfts.length,
        recent_transaction_count: transactions.length,
        transaction_type_breakdown: txTypes,
        staking: stakingInfo,
        key_type: account.key?._type || null,
        tokens: tokens.slice(0, 10).map(t => ({
          token_id: t.token_id,
          balance: t.balance,
          kyc_status: t.kyc_status || "NOT_APPLICABLE",
          freeze_status: t.freeze_status || "NOT_APPLICABLE",
        })),
        identity_summary: ageDays > 365
          ? "Established account - over 1 year old with transaction history."
          : ageDays > 30
          ? "Active account - between 1 month and 1 year old."
          : "New account - less than 30 days old.",
        payment,
        timestamp: new Date().toISOString(),
      };
    }
  • Schema definition for the "identity_resolve" tool, including input requirements and description.
    {
      name: "identity_resolve",
      description: "Resolve a Hedera account ID or EVM address to its on-chain identity profile including account age, token holdings, transaction history, and any HCS-based identity records. Accepts both Hedera native IDs (0.0.123456) and EVM addresses (0x...). Costs 0.2 HBAR.",
      inputSchema: {
        type: "object",
        properties: {
          account_id: { type: "string", description: "Hedera account ID (e.g. 0.0.123456) or EVM address (e.g. 0x1234...)" },
          api_key: { type: "string", description: "Your HederaIntel API key" },
        },
        required: ["account_id", "api_key"],
      },
    },

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/mountainmystic/hederatoolbox'

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