Skip to main content
Glama

get_domain_events

Retrieve events associated with an ENS domain to analyze its activity history and interactions on the Ethereum Name Service network.

Instructions

Retrieve events associated with an ENS domain.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYes

Implementation Reference

  • main.py:229-267 (handler)
    The primary handler function for the 'get_domain_events' MCP tool. It is decorated with @mcp.tool() for registration, calls the helper query_domain_events, processes the events by type, and returns a formatted string summary.
    @mcp.tool()
    async def get_domain_events(domain: str) -> str:
        """Retrieve events associated with an ENS domain."""
        events = await query_domain_events(domain)
        if not events:
            return f"No events found for ENS domain: {domain}"
        
        event_summaries = []
        for event in events:
            event_type = event["__typename"]
            summary = f"Event: {event_type}\n"
            summary += f"Block Number: {event['blockNumber']}\n"
            summary += f"Transaction ID: {event['transactionID']}\n"
            
            if event_type == "Transfer":
                summary += f"New Owner: {event['owner']['id']}"
            elif event_type == "NewOwner":
                summary += f"New Owner: {event['owner']['id']}\nParent Domain: {event['parentDomain']['name']}"
            elif event_type == "NewResolver":
                addr = event['resolver']['addr']['id'] if event['resolver']['addr'] else "None"
                summary += f"Resolver Address: {event['resolver']['address']}\nResolver Addr: {addr}"
            elif event_type == "NewTTL":
                summary += f"TTL: {event['ttl']} seconds"
            elif event_type == "WrappedTransfer":
                summary += f"New Wrapped Owner: {event['owner']['id']}"
            elif event_type == "NameWrapped":
                expiry = datetime.datetime.fromtimestamp(int(event['expiryDate'])).strftime("%Y-%m-%d %H:%M:%S")
                summary += f"Wrapped Owner: {event['owner']['id']}\nName: {event['name']}\nFuses: {event['fuses']}\nExpiry: {expiry}"
            elif event_type == "NameUnwrapped":
                summary += f"Owner: {event['owner']['id']}"
            elif event_type == "FusesSet":
                summary += f"Fuses: {event['fuses']}"
            elif event_type == "ExpiryExtended":
                expiry = datetime.datetime.fromtimestamp(int(event['expiryDate'])).strftime("%Y-%m-%d %H:%M:%S")
                summary += f"New Expiry: {expiry}"
            
            event_summaries.append(summary)
        
        return "\n\n".join(event_summaries)
  • Supporting helper function that executes the GraphQL query to retrieve raw domain events from the ENS subgraph for the specified domain name.
    async def query_domain_events(name: str) -> List[Dict[str, Any]]:
        """Query the ENS Subgraph for domain events."""
        query = gql("""
            query GetDomainEvents($name: String!) {
              domains(where: { name: $name }) {
                events {
                  id
                  __typename
                  blockNumber
                  transactionID
                  ... on Transfer {
                    owner {
                      id
                    }
                  }
                  ... on NewOwner {
                    owner {
                      id
                    }
                    parentDomain {
                      name
                    }
                  }
                  ... on NewResolver {
                    resolver {
                      address
                      addr {
                        id
                      }
                    }
                  }
                  ... on NewTTL {
                    ttl
                  }
                  ... on WrappedTransfer {
                    owner {
                      id
                    }
                  }
                  ... on NameWrapped {
                    owner {
                      id
                    }
                    name
                    fuses
                    expiryDate
                  }
                  ... on NameUnwrapped {
                    owner {
                      id
                    }
                  }
                  ... on FusesSet {
                    fuses
                  }
                  ... on ExpiryExtended {
                    expiryDate
                  }
                }
              }
            }
        """)
        result = await graphql_client.execute_async(query, variable_values={"name": name})
        return result["domains"][0]["events"] if result["domains"] and result["domains"][0]["events"] else []
  • Embedded GraphQL schema/query definition (GetDomainEvents) that defines the structure and fields for fetching domain events data from the ENS subgraph.
    query = gql("""
        query GetDomainEvents($name: String!) {
          domains(where: { name: $name }) {
            events {
              id
              __typename
              blockNumber
              transactionID
              ... on Transfer {
                owner {
                  id
                }
              }
              ... on NewOwner {
                owner {
                  id
                }
                parentDomain {
                  name
                }
              }
              ... on NewResolver {
                resolver {
                  address
                  addr {
                    id
                  }
                }
              }
              ... on NewTTL {
                ttl
              }
              ... on WrappedTransfer {
                owner {
                  id
                }
              }
              ... on NameWrapped {
                owner {
                  id
                }
                name
                fuses
                expiryDate
              }
              ... on NameUnwrapped {
                owner {
                  id
                }
              }
              ... on FusesSet {
                fuses
              }
              ... on ExpiryExtended {
                expiryDate
              }
            }
          }
        }
    """)
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 but offers minimal behavioral insight. It states 'Retrieve events' but doesn't disclose critical traits like whether it's read-only (implied but not explicit), rate limits, authentication needs, pagination, or what happens on invalid domains. For a tool with no annotations, this leaves significant gaps in understanding its operation.

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, clear sentence with zero waste. It's front-loaded with the core action and resource, making it easy to scan. Every word contributes to understanding the tool's purpose without redundancy.

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 (retrieving events likely involves data processing), lack of annotations, no output schema, and 0% schema coverage, the description is incomplete. It doesn't explain what events are returned, their structure, or error handling. For a tool with these gaps, more context is needed to be fully usable.

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?

Schema description coverage is 0%, and the description adds no parameter details beyond what's in the schema. It mentions 'domain' but doesn't explain its format (e.g., ENS name like 'example.eth'), validation rules, or examples. With 1 parameter and low coverage, the description fails to compensate, leaving semantics unclear.

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 action ('Retrieve') and target ('events associated with an ENS domain'), making the purpose understandable. It distinguishes from sibling tools like 'get_domain_details' (which likely returns static data) and 'resolve_ens_name' (which resolves names to addresses). However, it doesn't specify what types of events (e.g., transfers, registrations) or their format, leaving some ambiguity.

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. The description implies it's for retrieving domain events, but doesn't clarify scenarios (e.g., audit trails, activity monitoring) or prerequisites. Without context, users might not know when this is preferred over 'get_domain_details' for domain information.

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