whois_ip
Retrieve WHOIS information for an IP address to identify ownership, registration details, and network information for IPv4 or IPv6 addresses.
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)Handler function that performs whois lookup for the given IP address using the whoisIp function from the 'whoiser' library, handles errors, and returns formatted text content.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 schema for input validation: requires an 'ip' parameter that is a valid IP address string.{ ip: z.string().ip() },
- src/index.ts:53-71 (registration)Registers the 'whois_ip' MCP tool with the server, specifying name, description, input schema, and handler function.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 }; } } );