set_email_forward
Configure email forwarding for a domain to redirect messages to existing addresses or set up custom MX records for mail routing.
Instructions
Set email forwarding for a domain. Forward emails to existing email addresses or configure MX records.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Domain name to configure email forwarding for | |
| params | Yes | Email forwarding parameters. Keys: forward_type ('forward'/'mx'), username0/exist_email0 (for forward type), mx_host0/mx_priority0 (for mx type) |
Implementation Reference
- src/tools/settings.ts:329-360 (handler)The tool definition and handler logic for set_email_forward, which processes the input parameters and calls the client service.
server.tool( "set_email_forward", "Set email forwarding for a domain. Forward emails to existing email " + "addresses or configure MX records.", { domain: z.string().describe("Domain name to configure email forwarding for"), params: z .record(z.string()) .describe( "Email forwarding parameters. Keys: forward_type ('forward'/'mx'), " + "username0/exist_email0 (for forward type), " + "mx_host0/mx_priority0 (for mx type)" ), }, async ({ domain, params }) => { try { const result = await client.setEmailForward(domain, params); 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 email forwarding: ${msg}` }, ], isError: true, }; } } - The underlying service method that executes the API call to set email forwarding.
async setEmailForward(domain: string, emailParams: Record<string, string>): Promise<DynadotResponse> { return this.call("set_email_forward", { domain, ...emailParams }); }