Skip to main content
Glama

renew_domain

Renew an existing domain registration using USDC payment via x402. Specify the domain and renewal period in years (1-10).

Instructions

Renew an existing domain registration. Requires USDC payment via x402.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesDomain to renew (e.g., 'myproject.com')
yearsNoRenewal period in years (1-10, default: 1)

Implementation Reference

  • The main handler function for the renew_domain tool. Posts to /domains/renew, handles async provisioning via job polling, and formats the result.
    export async function renewDomain(
      client: BloomfilterClient,
      params: { domain: string; years?: number },
    ): Promise<McpToolResult> {
      const keyError = client.requiresPrivateKey();
      if (keyError) return keyError;
    
      try {
        await client.ensureAuth();
    
        const response = await client.http.post<RenewalResponse>(
          "/domains/renew",
          { domain: params.domain, years: params.years ?? 1 },
          { headers: client.getAuthHeaders() },
        );
    
        let result = response.data;
    
        // Async provisioning — poll until complete
        if (response.status === 202 && result.jobId) {
          console.error(`[bloomfilter-mcp] Renewal queued (job ${result.jobId}), polling...`);
    
          const jobResult = await client.pollJobStatus(result.jobId);
          if (jobResult.result) {
            result = jobResult.result as RenewalResponse;
          }
        }
    
        // Format the result
        const lines = [`Domain renewed: ${result.domain}`];
    
        if (result.newExpiresAt) {
          lines.push(`New Expiry: ${result.newExpiresAt}`);
        }
        if (result.payment) {
          lines.push(`Cost: $${result.payment.amountUsd}`);
          if (result.payment.txHash) {
            lines.push(`Transaction: ${result.payment.txHash}`);
          }
          lines.push(`Network: ${result.payment.network}`);
        }
    
        return { content: [{ type: "text", text: lines.join("\n") }] };
      } catch (error) {
        return formatToolError(error);
      }
    }
  • The RenewalResponse type that defines the shape of the API response for domain renewal.
    export interface RenewalResponse {
      domain: string;
      renewedAt?: string;
      newExpiresAt?: string;
      jobId?: string;
      payment?: {
        amountUsd: string;
        txHash?: string;
        network: string;
        settled: boolean;
      };
    }
  • src/index.ts:134-149 (registration)
    Registration of the 'renew_domain' tool with the MCP server, defining its description, input schema (domain, years), and handler binding.
    // 5. renew_domain
    server.tool(
      "renew_domain",
      "Renew an existing domain registration. Requires USDC payment via x402.",
      {
        domain: z.string().describe("Domain to renew (e.g., 'myproject.com')"),
        years: z
          .number()
          .int()
          .min(1)
          .max(10)
          .optional()
          .describe("Renewal period in years (1-10, default: 1)"),
      },
      async (params) => renewDomain(client, params),
    );
Behavior3/5

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

With no annotations, the description carries full behavioral burden. It mentions the key payment requirement (USDC via x402) but does not disclose return values, error states (e.g., domain not found), or other side effects.

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?

Description is two concise sentences front-loaded with the purpose. No unnecessary words; every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and no annotations, the description is missing return value details, failure scenarios, and prerequisites. While the core purpose is clear, completeness for a renewal tool with payment is lacking.

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 coverage is 100% and both parameters have descriptions. The description adds no additional meaning beyond the schema, so baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description uses specific verb 'Renew' and resource 'existing domain registration', clearly distinguishing it from sibling tools like register_domain which handles new registrations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for renewal but does not explicitly state when to use this tool versus alternatives (e.g., register_domain). No exclusions or prerequisites are mentioned.

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/BloomFilter-Labs/mcp-server-bloomfilter'

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