Skip to main content
Glama

resolve_ens_name

Convert Ethereum Name Service (ENS) domains into their corresponding Ethereum addresses for blockchain interactions.

Instructions

Resolve an ENS name to its Ethereum address.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYes

Implementation Reference

  • main.py:150-160 (handler)
    The core handler function for the 'resolve_ens_name' tool. It queries domain data using the helper function and extracts the Ethereum address, preferring resolvedAddress or falling back to resolver.addr.
    async def resolve_ens_name(domain: str) -> str:
        """Resolve an ENS name to its Ethereum address."""
        domain_data = await query_ens_domain(domain)
        if not domain_data:
            return f"No data found for ENS domain: {domain}"
        
        # Prefer resolvedAddress, fallback to resolver.addr
        address = (domain_data["resolvedAddress"]["id"] if domain_data["resolvedAddress"]
                   else domain_data["resolver"]["addr"]["id"] if domain_data["resolver"] and domain_data["resolver"]["addr"]
                   else "None")
        return address
  • main.py:149-149 (registration)
    The @mcp.tool() decorator registers the resolve_ens_name function as an MCP tool.
    @mcp.tool()
  • main.py:27-82 (helper)
    Supporting helper function that performs a GraphQL query to fetch detailed ENS domain data from the subgraph, used by resolve_ens_name and other tools.
    async def query_ens_domain(name: str) -> Optional[Dict[str, Any]]:
        """Query the ENS Subgraph for domain details."""
        query = gql("""
            query GetDomain($name: String!) {
              domains(where: { name: $name }) {
                id
                name
                labelName
                labelhash
                subdomainCount
                resolvedAddress {
                  id
                }
                resolver {
                  address
                  addr {
                    id
                  }
                  contentHash
                  texts
                }
                ttl
                isMigrated
                createdAt
                owner {
                  id
                }
                registrant {
                  id
                }
                wrappedOwner {
                  id
                }
                expiryDate
                registration {
                  registrationDate
                  expiryDate
                  cost
                  registrant {
                    id
                  }
                  labelName
                }
                wrappedDomain {
                  expiryDate
                  fuses
                  owner {
                    id
                  }
                  name
                }
              }
            }
        """)
        result = await graphql_client.execute_async(query, variable_values={"name": name})
        return result["domains"][0] if result["domains"] else None
Behavior2/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 states the basic function but does not disclose behavioral traits such as error handling (e.g., for invalid names), rate limits, authentication needs, or whether it's a read-only operation. This leaves significant gaps for an agent to understand how to invoke it safely.

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 a single, efficient sentence that is front-loaded with the core purpose. There is no wasted language, making it highly concise and well-structured for quick understanding.

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 the tool's low complexity (one parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks completeness in usage guidelines, behavioral context, and parameter details, which could hinder an agent's ability to use it effectively without additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, with one parameter 'domain' undocumented. The description adds meaning by specifying that 'domain' is an 'ENS name', which clarifies the parameter's purpose beyond the schema's generic 'Domain' title. However, it does not provide format details (e.g., '.eth' suffix) or examples.

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 ('Resolve') and resource ('ENS name') with the outcome ('to its Ethereum address'). It distinguishes from siblings like 'get_domain_details' and 'get_domain_events' by focusing on address resolution rather than general details or event history.

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?

The description provides no guidance on when to use this tool versus alternatives like 'get_domain_details' or 'get_domain_events'. It lacks context on prerequisites, such as whether the ENS name must be registered or valid, and does not mention any exclusions or specific use cases.

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/kukapay/ens-mcp'

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