Skip to main content
Glama

get_whois_contact

Retrieve WHOIS contact information for domain names to identify registrants and administrative details during domain management workflows.

Instructions

Get domain WHOIS contact

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYes
providerNo

Implementation Reference

  • Main handler function that executes get_whois_contact tool logic: resolves the provider (either specified or auto-detected), validates provider supports WHOIS contact feature, and returns contact information for the domain
    export async function handleGetWhoisContact(input: { domain: string; provider?: string }, registry: ProviderRegistry) {
      const provider = input.provider ? registry.get(input.provider) : await registry.resolveProviderForDomain(input.domain);
      assertWhoisContact(provider.name(), (f) => provider.supports(f));
      return provider.getWhoisContact(input.domain);
    }
  • Contact interface defining the structure of WHOIS contact data returned by the tool (firstName, lastName, email, phone, address1, city, state, postalCode, country)
    export interface Contact {
      firstName: string;
      lastName: string;
      email: string;
      phone: string;
      address1: string;
      city: string;
      state: string;
      postalCode: string;
      country: string; // ISO 3166-1 alpha-2
    }
  • src/server.ts:320-331 (registration)
    Tool registration with MCP server using server.tool(), defining input schema with domain (required) and provider (optional) parameters, and wiring up the handler
    server.tool('get_whois_contact', 'Get domain WHOIS contact', {
      domain: domainSchema,
      provider: z.string().optional(),
    }, async (input) => {
      try {
        const { handleGetWhoisContact } = await import('./tools/contacts.js');
        const result = await handleGetWhoisContact(input as { domain: string; provider?: string }, registry);
        return { content: [{ type: 'text', text: JSON.stringify(result) }] };
      } catch (err) {
        return { content: [{ type: 'text', text: formatErrorForAgent(err) }], isError: true };
      }
    });
  • Domain schema validation using Zod regex pattern to validate fully-qualified domain names per RFC 1123
    const domainSchema = z
      .string()
      .regex(
        /^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,
        'Must be a valid domain name (e.g. example.com)',
      );
  • Validation helper that checks if the selected provider supports the WhoisContact feature, throwing AgentError if not supported
    export function assertWhoisContact(providerName: string, supports: (f: Feature) => boolean): void {
      if (!supports(Feature.WhoisContact)) {
        throw new AgentError(
          'FEATURE_NOT_SUPPORTED',
          `Provider '${providerName}' does not support WHOIS contact management via API.`,
          'Use Namecheap or GoDaddy for WHOIS contact management, or update contacts via the provider web interface.',
          providerName,
        );
      }
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/oso95/domain-suite-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server