Skip to main content
Glama

get-ens-name

Retrieve the primary ENS name for a blockchain address to identify wallet owners and simplify interactions with Ethereum-based systems.

Instructions

Get the primary ENS name for address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYes
chainIdNo
blockNumberNo

Implementation Reference

  • Implements the core logic of the 'get-ens-name' tool by using wagmi's getEnsName function to retrieve the primary ENS name for the given address, with optional chainId and blockNumber parameters.
    execute: async (args) => {
      const address = args.address as Address
      const chainId = args.chainId as typeof wagmiConfig['chains'][number]['id']
      const blockNumber = args.blockNumber ? BigInt(args.blockNumber) : undefined
      const result = await getEnsName(wagmiConfig, {
        address,
        blockNumber,
        chainId,
      })
      return {
        content: [
          {
            type: "text",
            text: result ?? "undefined",
          },
        ],
      }
    },
  • Defines the input schema using Zod for the tool: required address (string), optional chainId and blockNumber (coerced to number).
    parameters: z.object({
      address: z.string(),
      chainId: z.coerce.number().optional(),
      blockNumber: z.coerce.number().optional(),
    }),
  • Registers the 'get-ens-name' tool on the FastMCP server, specifying name, description, schema, and handler.
    export function registerGetENSNameTools(server: FastMCP): void {
      server.addTool({
        name: "get-ens-name",
        description: "Get the primary ENS name for address",
        parameters: z.object({
          address: z.string(),
          chainId: z.coerce.number().optional(),
          blockNumber: z.coerce.number().optional(),
        }),
        execute: async (args) => {
          const address = args.address as Address
          const chainId = args.chainId as typeof wagmiConfig['chains'][number]['id']
          const blockNumber = args.blockNumber ? BigInt(args.blockNumber) : undefined
          const result = await getEnsName(wagmiConfig, {
            address,
            blockNumber,
            chainId,
          })
          return {
            content: [
              {
                type: "text",
                text: result ?? "undefined",
              },
            ],
          }
        },
      });
    };
  • Invokes the registration function to add the 'get-ens-name' tool to the main MetaMask MCP server instance.
    registerGetENSNameTools(server);
  • Exports the get-ens-name tool module for use in the main tools index.
    export * from "./get-ens-name.js";
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 states what the tool does but doesn't cover critical aspects like whether it's a read-only operation, potential rate limits, error conditions, or what happens if no ENS name exists for the address. This is a significant gap for a tool with no annotation coverage.

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 extremely concise at just one sentence with no wasted words. It's front-loaded with the core purpose and uses straightforward language. Every word earns its place, making it efficient despite its brevity.

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 blockchain/ENS operations, three parameters with 0% schema coverage, no annotations, and no output schema, the description is inadequate. It doesn't explain what 'primary ENS name' means, how results are returned, or handle edge cases. The agent would struggle to use this tool correctly without additional context.

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%, meaning none of the three parameters (address, chainId, blockNumber) are documented in the schema. The description only mentions 'address' without explaining its format or purpose, and completely omits chainId and blockNumber. It adds minimal value beyond what's implied by the tool name.

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 verb 'Get' and the resource 'primary ENS name for address', making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'get-ens-address' (which appears to do the reverse lookup), leaving room for potential confusion.

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-ens-address' or other address-related tools. It lacks context about prerequisites, typical use cases, or any exclusions, leaving the agent to infer usage from the tool name alone.

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/Xiawpohr/mcpilot'

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