create_contact
Create a new contact record for domain registrations by providing required details like name, email, phone, and address information.
Instructions
Create a new contact record for use with domain registrations. Required fields: name, email, phone_num, address1, city, state, zip_code, country.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Contact full name | |
| Yes | Contact email address | ||
| phone_num | Yes | Phone number with country code (e.g., '+1.5551234567') | |
| address1 | Yes | Street address line 1 | |
| address2 | No | Street address line 2 | |
| city | Yes | City | |
| state | Yes | State or province | |
| zip_code | Yes | Postal/ZIP code | |
| country | Yes | Country code (e.g., 'US', 'KR') | |
| organization | No | Organization name | |
| fax_num | No | Fax number |
Implementation Reference
- src/tools/contact.ts:21-71 (registration)Registration and MCP handler for the 'create_contact' tool.
server.tool( "create_contact", "Create a new contact record for use with domain registrations. " + "Required fields: name, email, phone_num, address1, city, state, " + "zip_code, country.", { name: z.string().describe("Contact full name"), email: z.string().describe("Contact email address"), phone_num: z.string().describe("Phone number with country code (e.g., '+1.5551234567')"), address1: z.string().describe("Street address line 1"), address2: z.string().optional().describe("Street address line 2"), city: z.string().describe("City"), state: z.string().describe("State or province"), zip_code: z.string().describe("Postal/ZIP code"), country: z.string().describe("Country code (e.g., 'US', 'KR')"), organization: z.string().optional().describe("Organization name"), fax_num: z.string().optional().describe("Fax number"), }, async ({ name, email, phone_num, address1, address2, city, state, zip_code, country, organization, fax_num }) => { try { const fields: Record<string, string> = { name, email, phone_num, address1, city, state, zip_code, country, }; if (address2) fields.address2 = address2; if (organization) fields.organization = organization; if (fax_num) fields.fax_num = fax_num; const result = await client.createContact(fields); 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 create contact: ${msg}` }, ], isError: true, }; } } ); - src/services/dynadot-client.ts:256-258 (handler)Service method in DynadotClient that invokes the Dynadot API 'create_contact' command.
async createContact(fields: Record<string, string>): Promise<DynadotResponse> { return this.call("create_contact", fields); }