Skip to main content
Glama
blockscout

Blockscout MCP Server

Official

get_address_by_ens_name

Read-only

Convert ENS domain names to Ethereum addresses using blockchain data from the Blockscout MCP Server.

Instructions

Useful for when you need to convert an ENS domain name (e.g. "blockscout.eth") to its corresponding Ethereum address.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesENS domain name to resolve

Implementation Reference

  • The core handler function that resolves the ENS domain name to an Ethereum address by querying the bens API, processing the response, and returning a structured ToolResponse with EnsAddressData.
    async def get_address_by_ens_name(
        name: Annotated[str, Field(description="ENS domain name to resolve")], ctx: Context
    ) -> ToolResponse[EnsAddressData]:
        """
        Useful for when you need to convert an ENS domain name (e.g. "blockscout.eth")
        to its corresponding Ethereum address.
        """
        # TODO: add support for other chains
        api_path = f"/api/v1/1/domains/{name}"
    
        # Report start of operation
        await report_and_log_progress(
            ctx,
            progress=0.0,
            total=1.0,
            message=f"Resolving ENS name {name}...",
        )
    
        response_data = await make_bens_request(api_path=api_path)
    
        # Report completion
        await report_and_log_progress(
            ctx,
            progress=1.0,
            total=1.0,
            message=f"Successfully resolved ENS name {name}.",
        )
    
        # Only the address hash is added to the response
        resolved_address_info = response_data.get("resolved_address", {})
        address_hash = resolved_address_info.get("hash") if resolved_address_info else None
        ens_data = EnsAddressData(resolved_address=address_hash)
    
        return build_tool_response(data=ens_data)
  • Pydantic model defining the output schema for the resolved ENS address.
    # --- Model for get_address_by_ens_name Data Payload ---
    class EnsAddressData(BaseModel):
        """A structured representation of an ENS name resolution."""
    
        resolved_address: str | None = Field(
            None,
            description=("The resolved Ethereum address corresponding to the ENS name, or null if not found."),
        )
  • Registration of the tool in the FastMCP server instance with annotations and structured_output set to False.
    mcp.tool(
        structured_output=False,
        annotations=create_tool_annotations("Get Address by ENS Name"),
    )(get_address_by_ens_name)
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=true, covering safety and scope. The description adds useful context about the conversion process but does not disclose behavioral traits like rate limits, error handling, or what happens with invalid ENS names.

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 tool's purpose. There is no wasted text, and it directly addresses the core functionality without unnecessary elaboration.

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 simple single-parameter input, high schema coverage, and annotations covering safety, the description is adequate. However, without an output schema, it does not explain return values (e.g., address format, null for unresolved names), leaving some gaps in completeness.

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%, with the parameter 'name' well-documented in the schema. The description adds minimal value by reinforcing that it's an 'ENS domain name' but does not provide additional semantics beyond what the schema already states.

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 tool's purpose with a specific verb ('convert') and resource ('ENS domain name to Ethereum address'), and distinguishes it from siblings by focusing on ENS resolution rather than general address info or blockchain data retrieval.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('when you need to convert an ENS domain name'), but does not explicitly mention when not to use it or name alternatives like 'get_address_info' which might handle non-ENS addresses.

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

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