Skip to main content
Glama

get-ens-name

Retrieve the ENS name associated with an Ethereum address to identify wallet owners and simplify blockchain interactions.

Instructions

Get the ENS name for an Ethereum address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesEthereum address (0x format)

Implementation Reference

  • Handler for 'get-ens-name' tool: parses input using AddressSchema, calls etherscanService.getENSName(address), formats response.
    if (name === "get-ens-name") {
      try {
        const { address } = AddressSchema.parse(args);
        const ensName = await etherscanService.getENSName(address);
        const response = ensName
          ? `ENS name for ${address}: ${ensName}`
          : `No ENS name found for ${address}`;
        return {
          content: [{ type: "text", text: response }],
        };
      } catch (error) {
        if (error instanceof z.ZodError) {
          throw new Error(`Invalid input: ${error.errors.map(e => e.message).join(", ")}`);
        }
        throw error;
      }
    }
  • src/server.ts:135-149 (registration)
    Tool registration in listTools response, including name, description, and inputSchema.
    {
      name: "get-ens-name",
      description: "Get the ENS name for an Ethereum address",
      inputSchema: {
        type: "object",
        properties: {
          address: {
            type: "string",
            description: "Ethereum address (0x format)",
            pattern: "^0x[a-fA-F0-9]{40}$"
          },
        },
        required: ["address"],
      },
    },
  • Zod schema for validating Ethereum address input, used in get-ens-name handler.
    const AddressSchema = z.object({
      address: z.string().regex(/^0x[a-fA-F0-9]{40}$/, 'Invalid Ethereum address format'),
    });
  • EtherscanService.getENSName method: core logic using ethers.provider.lookupAddress to resolve ENS name from address.
    async getENSName(address: string): Promise<string | null> {
      try {
        const validAddress = ethers.getAddress(address);
        return await this.provider.lookupAddress(validAddress);
      } catch (error) {
        if (error instanceof Error) {
          throw new Error(`Failed to get ENS name: ${error.message}`);
        }
        throw error;
      }
    }
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 of behavioral disclosure. It states the tool 'Get[s] the ENS name' but doesn't describe what happens if the address has no ENS name (e.g., returns null, error), whether it requires network access, rate limits, or authentication. This leaves significant gaps for a tool interacting with external systems.

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 highly efficient and easy to parse without unnecessary details.

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 complexity of interacting with Ethereum and ENS (Ethereum Name Service), the description is incomplete. It lacks output details (no output schema provided), doesn't explain behavioral aspects like error handling or network dependencies, and doesn't address usage context relative to sibling tools, making it inadequate for full understanding.

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?

The schema description coverage is 100%, with the parameter 'address' fully documented in the schema (type, format, pattern). The description adds no additional meaning beyond what the schema provides, such as examples or edge cases, so it meets the baseline score of 3 for high schema coverage.

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 ('Get') and resource ('ENS name'), and it specifies the target ('Ethereum address'). However, it doesn't explicitly differentiate from sibling tools like 'get-contract-abi' or 'get-transactions', which might also involve Ethereum addresses but serve different purposes.

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. It doesn't mention scenarios like verifying address ownership, looking up human-readable names, or how it differs from sibling tools such as 'check-balance' or 'get-token-transfers', which also operate on Ethereum 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/otc-ai/mcp-otc'

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