Skip to main content
Glama

check-availability

Verify if an Ethereum Name Service (ENS) domain is available for registration by entering the desired name. Use this tool to confirm domain eligibility before proceeding.

Instructions

Check if an ENS name is available for registration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe ENS name to check (without .eth suffix)

Implementation Reference

  • The core handler function that implements the logic for checking ENS name availability. It normalizes the name, uses publicClient.getAvailable to check status, fetches owner if taken, and returns formatted response or error.
    export async function checkAvailability( { name }: { name: string }): Promise<ServerResponse> { const normalizedName = normalizeName(name); try { const available = await publicClient.getAvailable({ name: normalizedName }); if (available) { return { content: [{ type: "text", text: `The name ${normalizedName} is available for registration.` }], isError: false }; } else { const owner = await publicClient.getOwner({ name: normalizedName }); return { content: [{ type: "text", text: `The name ${normalizedName} is already registered. ` + (owner ? `Current owner: ${owner.owner}` : "") }], isError: false }; } } catch (error) { const errorMessage = handleEnsError(error, "name availability check"); return { content: [{ type: "text", text: errorMessage }], isError: true }; } }
  • index.ts:59-66 (registration)
    Registers the 'check-availability' tool with the MCP server, defining its name, description, input schema, and delegates execution to the checkAvailability function.
    server.tool( "check-availability", "Check if an ENS name is available for registration", { name: z.string().describe("The ENS name to check (without .eth suffix)"), }, async (params) => checkAvailability( params) );
  • Input schema for the tool using Zod, specifying the 'name' parameter as a string.
    { name: z.string().describe("The ENS name to check (without .eth suffix)"), },

Other Tools

Related 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/JustaName-id/ens-mcp-server'

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