whois_domain
Retrieve domain registration details including ownership, availability, and contact information through WHOIS lookup.
Instructions
Looksup whois information about the domain
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes |
Implementation Reference
- src/index.ts:15-28 (handler)Handler function that performs the whoisDomain lookup using the imported whoisDomain function, formats the result as text content, and handles errors.async ({ domain }) => { try { const result = await whoisDomain(domain); return { content: [{ type: 'text', text: `Domain whois lookup for: \n${JSON.stringify(result)}` }], }; } catch (err: unknown) { const error = err as Error; return { content: [{ type: 'text', text: `Error: ${error.message}` }], isError: true }; } }
- src/index.ts:14-14 (schema)Zod schema defining the input parameter 'domain' as a non-empty string.{ domain: z.string().min(1) },
- src/index.ts:11-29 (registration)Registers the 'whois_domain' tool with the MCP server, including name, description, input schema, and inline handler function.server.tool( 'whois_domain', 'Looksup whois information about the domain', { domain: z.string().min(1) }, async ({ domain }) => { try { const result = await whoisDomain(domain); return { content: [{ type: 'text', text: `Domain whois lookup for: \n${JSON.stringify(result)}` }], }; } catch (err: unknown) { const error = err as Error; return { content: [{ type: 'text', text: `Error: ${error.message}` }], isError: true }; } } );
- src/index.ts:6-6 (helper)Imports the whoisDomain function from the external 'whoiser' library, used by the tool handler.import { whoisAsn, whoisDomain, whoisTld, whoisIp } from 'whoiser';