Skip to main content
Glama

whois_ip

Retrieve WHOIS details for any IP address (IPv4 or IPv6) to identify domain ownership, registration information, and other IP-related data. Simplify IP lookup tasks with direct access to authoritative records.

Instructions

Looksup whois information about the IP

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipYes

Implementation Reference

  • Handler function that executes the whois_ip tool by calling whoisIp(ip) from the '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 }; } }
  • Input schema for the whois_ip tool, validating the 'ip' parameter as a string IP address using Zod.
    { ip: z.string().ip() },
  • src/index.ts:53-71 (registration)
    Registration of the 'whois_ip' tool on the MCP server, including 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 }; } } );
  • Import of the whoisIp helper function from the external 'whoiser' library, used in the whois_ip tool handler.
    import { whoisAsn, whoisDomain, whoisTld, whoisIp } from 'whoiser';

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bharathvaj-ganesan/whois-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server