Skip to main content
Glama

get_domain_details

Fetch detailed information for an ENS domain, including its address, to resolve and analyze domain activity.

Instructions

Fetch detailed information for an ENS domain, including its address.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYes

Implementation Reference

  • main.py:162-227 (handler)
    Handler function decorated with @mcp.tool(), which registers the tool and infers input schema from type annotations (domain: str). Executes the core logic to fetch and format ENS domain details using the query_ens_domain helper.
    @mcp.tool()
    async def get_domain_details(domain: str) -> str:
        """Fetch detailed information for an ENS domain, including its address."""
        domain_data = await query_ens_domain(domain)
        if not domain_data:
            return f"No data found for ENS domain: {domain}"
        
        # Get address
        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")
        
        # Format dates
        expiry = (datetime.datetime.fromtimestamp(int(domain_data["expiryDate"]))
                  .strftime("%Y-%m-%d %H:%M:%S") if domain_data["expiryDate"]
                  else "None")
        created = (datetime.datetime.fromtimestamp(int(domain_data["createdAt"]))
                   .strftime("%Y-%m-%d %H:%M:%S") if domain_data["createdAt"]
                   else "None")
        
        # Registration details
        registration_info = (
            f"Registration Date: {datetime.datetime.fromtimestamp(int(domain_data['registration']['registrationDate'])).strftime('%Y-%m-%d %H:%M:%S')}\n"
            f"Registration Expiry: {datetime.datetime.fromtimestamp(int(domain_data['registration']['expiryDate'])).strftime('%Y-%m-%d %H:%M:%S')}\n"
            f"Registration Cost: {domain_data['registration']['cost'] or 'Unknown'} Wei\n"
            f"Registrant: {domain_data['registration']['registrant']['id']}"
            if domain_data["registration"]
            else "No Registration"
        )
        
        # Wrapped domain details
        wrapped_info = (
            f"Wrapped Name: {domain_data['wrappedDomain']['name']}\n"
            f"Wrapped Owner: {domain_data['wrappedDomain']['owner']['id']}\n"
            f"Wrapped Expiry: {datetime.datetime.fromtimestamp(int(domain_data['wrappedDomain']['expiryDate'])).strftime('%Y-%m-%d %H:%M:%S')}\n"
            f"Fuses: {domain_data['wrappedDomain']['fuses']}"
            if domain_data["wrappedDomain"]
            else "Not Wrapped"
        )
        
        # Resolver details
        resolver_info = (
            f"Resolver Address: {domain_data['resolver']['address']}\n"
            f"Content Hash: {domain_data['resolver']['contentHash'] or 'None'}\n"
            f"Text Records: {', '.join(domain_data['resolver']['texts']) if domain_data['resolver']['texts'] else 'None'}"
            if domain_data["resolver"]
            else "No Resolver"
        )
        
        return (
            f"ENS Domain: {domain_data['name']}\n"
            f"Address: {address}\n"
            f"Label Name: {domain_data['labelName'] or 'None'}\n"
            f"Label Hash: {domain_data['labelhash'] or 'None'}\n"
            f"Subdomain Count: {domain_data['subdomainCount']}\n"
            f"Owner: {domain_data['owner']['id']}\n"
            f"Registrant: {domain_data['registrant']['id'] if domain_data['registrant'] else 'None'}\n"
            f"Wrapped Owner: {domain_data['wrappedOwner']['id'] if domain_data['wrappedOwner'] else 'None'}\n"
            f"Expiry Date: {expiry}\n"
            f"TTL: {domain_data['ttl'] or 'None'} seconds\n"
            f"Is Migrated: {domain_data['isMigrated']}\n"
            f"Created At: {created}\n"
            f"Registration: {registration_info}\n"
            f"Wrapped Domain: {wrapped_info}\n"
            f"Resolver: {resolver_info}"
        )
  • main.py:27-82 (helper)
    Supporting helper utility that queries the ENS subgraph via GraphQL for detailed domain data, which is then processed by the get_domain_details handler.
    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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions fetching detailed information, implying a read-only operation, but fails to describe critical traits such as error handling (e.g., for invalid domains), rate limits, authentication needs, or response format. This leaves significant gaps in understanding how the tool behaves beyond its basic function.

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 front-loads the core purpose without unnecessary words. Every part earns its place by specifying the action, resource, and key output, making it easy to parse and understand quickly.

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 the tool's complexity (a read operation with one parameter) and the lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects like error cases or response structure, nor does it provide parameter details. While concise, it omits necessary context for effective tool invocation.

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

Parameters2/5

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

The input schema has 0% description coverage, with one undocumented parameter ('domain'). The description adds no meaning beyond the schema, as it doesn't explain what 'domain' represents (e.g., format like 'example.eth', validation rules, or examples). This fails to compensate for the low schema coverage, leaving the parameter poorly defined.

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 with a specific verb ('Fetch') and resource ('detailed information for an ENS domain'), including the key output ('including its address'). It distinguishes from sibling tools like 'get_domain_events' (which likely focuses on events) and 'resolve_ens_name' (which might resolve names to addresses without detailed info). However, it doesn't explicitly differentiate from siblings in the text, preventing 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 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 'resolve_ens_name'. It lacks explicit instructions on use cases, prerequisites, or exclusions, leaving the agent to infer usage from the purpose alone. This minimal guidance is insufficient for optimal tool selection.

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