Skip to main content
Glama

get-registration-price

Calculate the cost to register an ENS name by specifying the desired name and registration duration in years through the ENS MCP Server.

Instructions

Get the price to register an ENS name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
durationNoRegistration duration in years
nameYesThe ENS name to check price for (without .eth suffix)

Implementation Reference

  • The handler function that implements the core logic for getting the ENS registration price. Normalizes the name, calculates duration in seconds, fetches price via publicClient.getPrice, formats using ethers.formatEther, and handles errors.
    export async function getRegistrationPrice( { name, duration = 1 }: { name: string, duration?: number }): Promise<ServerResponse> {
        const normalizedName = normalizeName(name);
        try {
            
            const durationInSeconds = duration * 365 * 24 * 60 * 60;
    
            
            const price = await publicClient.getPrice({
                nameOrNames: normalizedName,
                duration: durationInSeconds
            });
    
            return {
                content: [{
                    type: "text",
                    text: `Registration price for ${normalizedName} for ${duration} year(s):\n` +
                        `- Base Price: ${ethers.formatEther(price.base)} ETH\n` +
                        `- Premium: ${ethers.formatEther(price.premium)} ETH\n` +
                        `- Total: ${ethers.formatEther(price.base + price.premium)} ETH`
                }],
                isError: false
            };
        } catch (error) {
            const errorMessage = handleEnsError(error, "get registration price");
    
            return {
                content: [{ type: "text", text: errorMessage }],
                isError: true
            };
        }
    }
  • index.ts:99-107 (registration)
    MCP server tool registration for 'get-registration-price', including description, Zod input schema, and reference to the handler function.
    server.tool(
        "get-registration-price",
        "Get the price to register an ENS name",
        {
            name: z.string().describe("The ENS name to check price for (without .eth suffix)"),
            duration: z.number().int().min(1).describe("Registration duration in years").default(1) ,
        },
        async (params) => getRegistrationPrice( params)
    );
  • Zod schema defining input parameters: name (string) and duration (number, default 1, min 1).
    {
        name: z.string().describe("The ENS name to check price for (without .eth suffix)"),
        duration: z.number().int().min(1).describe("Registration duration in years").default(1) ,
    },
  • ENS public client configuration used by the handler to call getPrice method.
    export const publicClient: EnsPublicClient = createEnsPublicClient({
        chain: mainnet,
        transport: configureTransport()
    });
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but lacks critical behavioral details: it doesn't specify if this is a read-only operation (implied but not stated), whether it requires authentication, rate limits, network calls, or what the output format looks like (e.g., currency, units). For a tool with zero annotation coverage, this is a significant gap in transparency.

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 directly states the tool's purpose without any fluff. It's front-loaded with the core action and resource, making it easy to parse. Every word earns its place, achieving optimal conciseness for this simple tool.

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 tool's moderate complexity (price calculation for registrations), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects (e.g., read-only nature, potential errors), output details (e.g., price format), or usage context (e.g., when to call it relative to availability checks). For a tool with no structured safety or output information, more descriptive context is needed.

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 both parameters ('name' and 'duration') well-documented in the schema. The description adds no additional parameter semantics beyond what the schema provides (e.g., it doesn't explain format constraints like name length or validation rules). Baseline 3 is appropriate when the schema does the heavy lifting, but no extra value is added.

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 action ('Get the price') and resource ('to register an ENS name'), making the purpose immediately understandable. It distinguishes from siblings like 'check-availability' (which checks name availability) or 'resolve-name' (which resolves addresses). However, it doesn't explicitly differentiate from all siblings (e.g., 'get-all-records' might also involve pricing data), keeping it at 4 rather than 5.

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 prerequisites (e.g., name must be available), exclusions (e.g., invalid names), or relationships with siblings like 'check-availability' (which might be a prerequisite). Usage is implied but not explicitly stated, resulting in minimal guidance.

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

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