whois_ip
Retrieve WHOIS information for an IP address to identify ownership, registration dates, and network details. Use this tool to investigate IP origins and network administration.
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 executes the whois_ip tool: calls whoisIp from external library, formats result as text content or error.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)Input schema for whois_ip tool using Zod to validate 'ip' parameter as a valid IP address.{ ip: z.string().ip() },
- src/index.ts:53-71 (registration)Registration of the 'whois_ip' tool with the MCP server using server.tool(name, description, schema, 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 }; } } );