set_forwarding
Configure URL forwarding for domains to redirect visitors or display content in an iframe with custom titles.
Instructions
Set URL forwarding for a domain. Supports standard forwarding (301/302 redirect) and stealth forwarding (iframe with custom title).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Domain name to set forwarding for | |
| url | Yes | Target URL to forward to | |
| stealth | No | Use stealth forwarding (iframe) instead of redirect | |
| stealth_title | No | Page title for stealth forwarding | |
| is_temporary | No | Use 302 (temporary) redirect instead of 301 (permanent) |
Implementation Reference
- src/services/dynadot-client.ts:344-348 (handler)The API client method that executes the 'set_forwarding' command.
async setForwarding(domain: string, url: string, isTemp?: boolean): Promise<DynadotResponse> { const params: Record<string, string> = { domain, forward_url: url }; if (isTemp) params.is_temp = "1"; return this.call("set_forwarding", params); } - src/tools/settings.ts:105-148 (registration)The tool registration and handler implementation for 'set_forwarding' in the settings tools module.
server.tool( "set_forwarding", "Set URL forwarding for a domain. Supports standard forwarding (301/302 " + "redirect) and stealth forwarding (iframe with custom title).", { domain: z.string().describe("Domain name to set forwarding for"), url: z.string().describe("Target URL to forward to"), stealth: z .boolean() .optional() .describe("Use stealth forwarding (iframe) instead of redirect"), stealth_title: z .string() .optional() .describe("Page title for stealth forwarding"), is_temporary: z .boolean() .optional() .describe("Use 302 (temporary) redirect instead of 301 (permanent)"), }, async ({ domain, url, stealth, stealth_title, is_temporary }) => { try { let result; if (stealth) { result = await client.setStealth(domain, url, stealth_title); } else { result = await client.setForwarding(domain, url, is_temporary); } 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: `Failed to set forwarding: ${msg}` }, ], isError: true, }; } } );