Skip to main content
Glama

getEnsResolutionGuidance

Resolve ENS names to addresses and retrieve blockchain data like balances, transaction counts, or contract code across different Ethereum networks.

Instructions

Get guidance for resolving ENS names across networks and performing operations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ensNameYesThe ENS name to resolve (e.g., 'vitalik.eth')
targetNetworkYesThe target network to perform operations on (e.g., 'MEGA Testnet', 'Optimism')
operationYesThe operation to perform: 'balance' for ETH balance, 'txCount' for transaction count, 'code' for contract code

Implementation Reference

  • The handler function for the 'getEnsResolutionGuidance' tool. It generates step-by-step textual guidance for resolving an ENS name on Ethereum and performing the specified operation (balance, txCount, or code) on a target network using other tools.
        async ({ ensName, targetNetwork, operation }) => {
          try {
          
          // Define guidance for each type of operation
          let operationGuidance = "";
          switch (operation) {
            case "balance":
              operationGuidance = `check the ETH balance of the resolved address on the ${targetNetwork} network`;
              break;
            case "txCount":
              operationGuidance = `check the transaction count of the resolved address on the ${targetNetwork} network`;
              break;
            case "code":
              operationGuidance = `check if the resolved address contains contract code on the ${targetNetwork} network`;
              break;
          }
    
          return {
            content: [{
              type: "text",
              text: `Guidance for resolving ENS name '${ensName}' and ${operationGuidance}:
    
    1. First, use the 'resolveName' tool with the provider set to 'Ethereum' to resolve the ENS name on Ethereum mainnet, as ENS domains are primarily registered there.
    
    2. Before proceeding with the target network:
       - Use the 'getAllNetworks' tool to verify the exact name of the '${targetNetwork}' network
       - If the provided name doesn't match exactly, identify the correct network name from the results
    
    3. After resolving the ENS name on Ethereum mainnet:
       - Use the resolved Ethereum address to perform the requested ${operation} operation on the target network
       - Use the appropriate tool ('getWalletBalance', 'getWalletTransactionCount', or 'getContractCode') with the provider parameter set to the verified target network name
    
    4. Present the results clearly, specifying both:
       - The original ENS name and its resolved address
       - The network on which the operation was performed
       - The complete results of the operation
    
    This approach ensures reliable ENS resolution while allowing operations across any supported blockchain network.`
            }]
          };
          } catch (error) {
            return createErrorResponse(error, 'getting ENS resolution guidance');
          }
        }
  • Zod schema defining the input parameters for the tool: ensName (string), targetNetwork (string), operation (enum: balance, txCount, code). Used for validation.
    {
      ensName: z.string().describe("The ENS name to resolve (e.g., 'vitalik.eth')"),
      targetNetwork: z.string().describe("The target network to perform operations on (e.g., 'MEGA Testnet', 'Optimism')"),
      operation: z.enum(["balance", "txCount", "code"]).describe("The operation to perform: 'balance' for ETH balance, 'txCount' for transaction count, 'code' for contract code")
    },
  • Registration of the 'getEnsResolutionGuidance' tool on the MCP server using server.tool(), including name, description, input schema, and handler function.
      server.tool(
        "getEnsResolutionGuidance",
        "Get guidance for resolving ENS names across networks and performing operations",
        {
          ensName: z.string().describe("The ENS name to resolve (e.g., 'vitalik.eth')"),
          targetNetwork: z.string().describe("The target network to perform operations on (e.g., 'MEGA Testnet', 'Optimism')"),
          operation: z.enum(["balance", "txCount", "code"]).describe("The operation to perform: 'balance' for ETH balance, 'txCount' for transaction count, 'code' for contract code")
        },
        async ({ ensName, targetNetwork, operation }) => {
          try {
          
          // Define guidance for each type of operation
          let operationGuidance = "";
          switch (operation) {
            case "balance":
              operationGuidance = `check the ETH balance of the resolved address on the ${targetNetwork} network`;
              break;
            case "txCount":
              operationGuidance = `check the transaction count of the resolved address on the ${targetNetwork} network`;
              break;
            case "code":
              operationGuidance = `check if the resolved address contains contract code on the ${targetNetwork} network`;
              break;
          }
    
          return {
            content: [{
              type: "text",
              text: `Guidance for resolving ENS name '${ensName}' and ${operationGuidance}:
    
    1. First, use the 'resolveName' tool with the provider set to 'Ethereum' to resolve the ENS name on Ethereum mainnet, as ENS domains are primarily registered there.
    
    2. Before proceeding with the target network:
       - Use the 'getAllNetworks' tool to verify the exact name of the '${targetNetwork}' network
       - If the provided name doesn't match exactly, identify the correct network name from the results
    
    3. After resolving the ENS name on Ethereum mainnet:
       - Use the resolved Ethereum address to perform the requested ${operation} operation on the target network
       - Use the appropriate tool ('getWalletBalance', 'getWalletTransactionCount', or 'getContractCode') with the provider parameter set to the verified target network name
    
    4. Present the results clearly, specifying both:
       - The original ENS name and its resolved address
       - The network on which the operation was performed
       - The complete results of the operation
    
    This approach ensures reliable ENS resolution while allowing operations across any supported blockchain network.`
            }]
          };
          } catch (error) {
            return createErrorResponse(error, 'getting ENS resolution guidance');
          }
        }
      );
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'guidance' but does not clarify what that entails—whether it returns instructions, metadata, or actionable data. It lacks details on permissions, rate limits, or behavioral traits like whether it's read-only or has side effects, which is a significant gap for a tool with no annotation coverage.

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

Conciseness4/5

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

The description is a single, efficient sentence that states the purpose without unnecessary words. It is front-loaded and appropriately sized, though it could be more specific to enhance clarity without losing conciseness.

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

Completeness2/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 is incomplete for a tool with 3 required parameters and complex operations. It does not explain what 'guidance' returns, how to interpret results, or handle errors, leaving significant gaps for an AI agent to use the tool effectively.

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 thoroughly. The description adds no additional meaning beyond the schema, such as explaining interactions between parameters or providing examples. Baseline is 3 when schema does the heavy lifting, but no extra value is added.

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

Purpose3/5

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

The description states the tool 'Get guidance for resolving ENS names across networks and performing operations', which provides a general purpose but lacks specificity about what 'guidance' means or what operations are available. It distinguishes from siblings like 'resolveName' by mentioning 'guidance', but the distinction is vague rather than clear.

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool versus alternatives like 'resolveName' or other ENS-related tools. The description implies usage for ENS resolution and operations, but does not specify contexts, prerequisites, or exclusions, leaving the agent to infer based on the tool name and parameters alone.

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/crazyrabbitLTC/mcp-ethers-server'

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