whois_ip
Retrieve WHOIS details for any IP address to identify ownership, registration dates, and status. Simplify domain and IP information lookup for accurate and efficient analysis.
Instructions
Looksup whois information about the IP
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes |
Implementation Reference
- src/index.ts:57-70 (handler)The async handler function that performs the IP whois lookup by calling the whoisIp function from 'whoiser' library, formats the result as text content, and handles errors.async ({ ip }) => { try { const result = await whoisIp(ip); return { content: [{ type: 'text', text: `IP 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:56-56 (schema)Zod input schema for the tool, validating the 'ip' parameter as a string IP address.{ ip: z.string().ip() },
- src/index.ts:53-71 (registration)MCP server.tool registration for the 'whois_ip' tool, including name, description, schema, and handler.server.tool( 'whois_ip', 'Looksup whois information about the IP', { ip: z.string().ip() }, async ({ ip }) => { try { const result = await whoisIp(ip); return { content: [{ type: 'text', text: `IP 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)Import statement for the whoisIp helper function from the external 'whoiser' library.import { whoisAsn, whoisDomain, whoisTld, whoisIp } from 'whoiser';