list_contacts
Retrieve all account contacts or get specific contact details by ID to manage domain registrar information.
Instructions
List all contacts in the account, or get details of a specific contact by ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contact_id | No | If provided, get details for this specific contact ID |
Implementation Reference
- src/tools/contact.ts:138-173 (handler)The list_contacts tool implementation, which accepts an optional contact_id. If contact_id is provided, it fetches a single contact; otherwise, it lists all contacts using the client.
server.tool( "list_contacts", "List all contacts in the account, or get details of a specific contact by ID.", { contact_id: z .string() .optional() .describe("If provided, get details for this specific contact ID"), }, async ({ contact_id }) => { try { if (contact_id) { const result = await client.getContact(contact_id); return { content: [ { type: "text" as const, text: JSON.stringify(result, null, 2) }, ], }; } const result = await client.listContacts(); 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 list contacts: ${msg}` }, ], isError: true, }; } } );