get_auth_code
Retrieve or generate the EPP authorization code required to transfer a domain to another registrar. Optionally unlock the domain during the process.
Instructions
Get the transfer authorization (EPP) code for a domain. This code is needed to transfer the domain to another registrar. Can optionally generate a new code and unlock the domain for transfer.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Domain name to get the auth code for | |
| new_code | No | Generate a new authorization code instead of returning the existing one | |
| unlock_for_transfer | No | Automatically unlock the domain for transfer when retrieving the code |
Implementation Reference
- src/tools/transfer.ts:116-153 (handler)The handler implementation for the 'get_auth_code' tool, which uses the DynadotClient to retrieve the authorization code.
server.tool( "get_auth_code", "Get the transfer authorization (EPP) code for a domain. This code is " + "needed to transfer the domain to another registrar. Can optionally " + "generate a new code and unlock the domain for transfer.", { domain: z.string().describe("Domain name to get the auth code for"), new_code: z .boolean() .optional() .describe("Generate a new authorization code instead of returning the existing one"), unlock_for_transfer: z .boolean() .optional() .describe("Automatically unlock the domain for transfer when retrieving the code"), }, async ({ domain, new_code, unlock_for_transfer }) => { try { const result = await client.getTransferAuthCode(domain, { newCode: new_code, unlockForTransfer: unlock_for_transfer, }); 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 get auth code: ${msg}` }, ], isError: true, }; } } );