Skip to main content
Glama
badchars

osint-mcp-server

by badchars

whois_domain

Look up domain WHOIS/RDAP information to obtain registrar, registration and expiration dates, nameservers, and contact entities.

Instructions

RDAP/WHOIS lookup for a domain. Returns registrar, registration/expiration dates, nameservers, and contact entities.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesDomain name to look up

Implementation Reference

  • Main handler function for 'whois_domain' tool. Calls the RDAP API (rdap.org/domain/{domain}), parses the JSON response, and extracts nameservers, entities (registrar, contacts with vcard data), registration/expiration/last-updated dates, and returns a structured RdapDomainResult.
    export async function whoisDomain(domain: string): Promise<RdapDomainResult> {
      await limiter.acquire();
      const res = await fetch(`https://rdap.org/domain/${domain}`);
      if (!res.ok) throw new Error(`RDAP domain lookup failed: ${res.status} ${res.statusText}`);
      const data = await res.json();
    
      const nameservers: string[] = [];
      if (data.nameservers) {
        for (const ns of data.nameservers) {
          if (ns.ldhName) nameservers.push(ns.ldhName);
        }
      }
    
      const entities: RdapDomainResult["entities"] = [];
      if (data.entities) {
        for (const ent of data.entities) {
          const roles = ent.roles ?? [];
          const vcard = ent.vcardArray?.[1];
          let name: string | undefined;
          let email: string | undefined;
          let phone: string | undefined;
    
          if (vcard) {
            for (const field of vcard) {
              if (field[0] === "fn") name = field[3];
              if (field[0] === "email") email = field[3];
              if (field[0] === "tel") phone = field[3];
            }
          }
    
          for (const role of roles) {
            entities.push({ role, name, email, phone });
          }
        }
      }
    
      // Extract dates from events
      let registrationDate: string | undefined;
      let expirationDate: string | undefined;
      let lastUpdated: string | undefined;
    
      if (data.events) {
        for (const evt of data.events) {
          if (evt.eventAction === "registration") registrationDate = evt.eventDate;
          if (evt.eventAction === "expiration") expirationDate = evt.eventDate;
          if (evt.eventAction === "last changed") lastUpdated = evt.eventDate;
        }
      }
    
      // Extract registrar from entities
      let registrar: string | undefined;
      const registrarEntity = data.entities?.find((e: any) => e.roles?.includes("registrar"));
      if (registrarEntity?.vcardArray?.[1]) {
        const fn = registrarEntity.vcardArray[1].find((f: any) => f[0] === "fn");
        if (fn) registrar = fn[3];
      }
    
      return {
        domain: data.ldhName ?? domain,
        status: data.status ?? [],
        registrar,
        registrationDate,
        expirationDate,
        lastUpdated,
        nameservers,
        entities,
        port43: data.port43,
      };
    }
  • Type definition for the result returned by whoisDomain, defining the shape of RDAP domain lookup response (domain, status, registrar, dates, nameservers, entities/contacts, port43).
    interface RdapDomainResult {
      domain: string;
      status: string[];
      registrar?: string;
      registrationDate?: string;
      expirationDate?: string;
      lastUpdated?: string;
      nameservers: string[];
      entities: { role: string; name?: string; email?: string; phone?: string }[];
      port43?: string;
    }
  • Tool registration definition for 'whois_domain'. Defines name, description, Zod schema (expects 'domain' string), and execute handler that calls whoisDomain() from src/whois/index.ts.
    const whoisDomainTool: ToolDef = {
      name: "whois_domain",
      description: "RDAP/WHOIS lookup for a domain. Returns registrar, registration/expiration dates, nameservers, and contact entities.",
      schema: {
        domain: z.string().describe("Domain name to look up"),
      },
      execute: async (args) => json(await whoisDomain(args.domain as string)),
    };
  • Registration of whoisDomainTool in the tool list (array exported for inclusion in the tool registry).
    whoisDomainTool,
    whoisIpTool,
  • Rate limiter used by whoisDomain (and whoisIp) to ensure requests are spaced at least 1000ms apart.
    import { RateLimiter } from "../utils/rate-limiter.js";
    
    const limiter = new RateLimiter(1000);
  • src/index.ts:28-28 (registration)
    Tool category listing for '--list' display, grouping whois_domain under 'WHOIS / RDAP' category.
    { label: "WHOIS / RDAP", env: null, tools: ["whois_domain", "whois_ip"] },
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description bears the full burden. It correctly indicates a read-only operation and lists the returned fields. It does not cover potential rate limits or data sources, but for a simple lookup tool, the transparency is adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence of 18 words, front-loaded with action and resource, no redundancy. Every word adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given a single parameter and no output schema, the description provides sufficient context about purpose and returns. It is complete enough for an agent to understand the tool's functionality, though it could mention output format or edge cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema covers the single parameter (domain) with a description 'Domain name to look up'. The tool description adds no additional parameter-specific details beyond listing return fields. With 100% schema coverage, the baseline is 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool performs 'RDAP/WHOIS lookup for a domain' and lists the exact data returned (registrar, dates, nameservers, contact entities). This distinguishes it from sibling tools like whois_ip (for IPs) and dns_lookup (for DNS records).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is used for domain WHOIS lookups, which is clear given the sibling context. However, it does not explicitly state when to use this vs. alternatives or mention any prerequisites or limitations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/badchars/osint-mcp-server'

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