st_whois
Retrieve enhanced WHOIS data including registrant, admin, and technical contacts for any domain using SecurityTrails.
Instructions
Enhanced WHOIS lookup via SecurityTrails with registrant/admin/technical contacts. Requires ST_API_KEY.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Domain to look up |
Implementation Reference
- src/securitytrails/index.ts:80-107 (handler)Core handler: Calls SecurityTrails WHOIS API at /domain/{domain}/whois, extracts registrar, dates, nameservers, and contacts (registrant/admin/technical).
export async function stWhois(domain: string, apiKey: string): Promise<StWhoisResult> { const data = await stFetch(`/domain/${encodeURIComponent(domain)}/whois`, apiKey); const w = data ?? {}; const contacts: StWhoisResult["contacts"] = []; for (const type of ["registrant", "admin", "technical"]) { const c = w[type]; if (c) { contacts.push({ type, name: c.name, organization: c.organization, email: c.email, country: c.country, }); } } return { domain, registrar: w.registrar?.name, createdDate: w.created_date, updatedDate: w.updated_date, expiresDate: w.expires_date, nameservers: w.nameservers ?? [], contacts, }; } - src/securitytrails/index.ts:30-38 (schema)Type definition for StWhoisResult interface with domain, registrar, dates, nameservers, and contacts.
interface StWhoisResult { domain: string; registrar?: string; createdDate?: string; updatedDate?: string; expiresDate?: string; nameservers: string[]; contacts: { type: string; name?: string; organization?: string; email?: string; country?: string }[]; } - src/protocol/tools.ts:260-270 (registration)Tool registration as ToolDef with name 'st_whois', Zod schema for domain, and execute handler that calls stWhois().
const stWhoisTool: ToolDef = { name: "st_whois", description: "Enhanced WHOIS lookup via SecurityTrails with registrant/admin/technical contacts. Requires ST_API_KEY.", schema: { domain: z.string().describe("Domain to look up"), }, execute: async (args, ctx) => { const key = requireApiKey(ctx.config.stApiKey, "SecurityTrails", "ST_API_KEY"); return json(await stWhois(args.domain as string, key)); }, }; - src/protocol/tools.ts:504-507 (registration)Tool listed in the allTools export array under SecurityTrails section.
// SecurityTrails (3) stSubdomainsTool, stDnsHistoryTool, stWhoisTool, - src/index.ts:36-40 (registration)Tool listed in SecurityTrails category requiring ST_API_KEY environment variable.
{ label: "Shodan", env: "SHODAN_API_KEY", tools: ["shodan_host", "shodan_search", "shodan_dns_resolve", "shodan_exploits"] }, { label: "VirusTotal", env: "VT_API_KEY", tools: ["vt_domain", "vt_ip", "vt_subdomains", "vt_url"] }, { label: "SecurityTrails", env: "ST_API_KEY", tools: ["st_subdomains", "st_dns_history", "st_whois"] }, { label: "Censys", env: "CENSYS_API_ID + CENSYS_API_SECRET", tools: ["censys_hosts", "censys_host_details", "censys_certificates"] }, ];