renew_domain
Extend domain registration periods through Dynadot's API. Specify domain name and renewal duration in years, optionally apply discount coupons, or check pricing before committing.
Instructions
Renew an existing domain registration. Duration is in years.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Domain name to renew | |
| duration | Yes | Renewal duration in years | |
| coupon | No | Coupon code for discount | |
| price_check | No | Only check the renewal price without renewing |
Implementation Reference
- src/tools/domain.ts:211-249 (handler)The handler for the renew_domain tool, which defines the tool's input schema and calls the DynadotClient.renewDomain method.
server.tool( "renew_domain", "Renew an existing domain registration. Duration is in years.", { domain: z.string().describe("Domain name to renew"), duration: z .number() .int() .min(1) .max(10) .describe("Renewal duration in years"), coupon: z.string().optional().describe("Coupon code for discount"), price_check: z .boolean() .optional() .describe("Only check the renewal price without renewing"), }, async ({ domain, duration, coupon, price_check }) => { try { const result = await client.renewDomain(domain, duration, { coupon, priceCheck: price_check, }); return { content: [ { type: "text" as const, text: JSON.stringify(result, null, 2) }, ], }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [ { type: "text" as const, text: `Domain renewal failed: ${msg}` }, ], isError: true, }; } } ); - The DynadotClient method that performs the API call to renew a domain.
async renewDomain(domain: string, duration: number, options?: { coupon?: string; priceCheck?: boolean; }): Promise<DynadotResponse> { const params: Record<string, string> = { domain, duration: duration.toString(), }; if (options?.coupon) params.coupon = options.coupon; if (options?.priceCheck) params.price_check = "1"; return this.call("renew", params); }