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
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The ENS name to check (without .eth suffix) |
Implementation Reference
- utils/index.ts:167-200 (handler)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) );
- index.ts:62-64 (schema)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)"), },