Skip to main content
Glama

whois_as

Retrieve WHOIS information for Autonomous System Numbers (ASNs) to identify network ownership and registration details.

Instructions

Looksup whois information about the Autonomous System Number (ASN)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
asnYes

Implementation Reference

  • The handler function for the 'whois_as' tool. It takes an ASN (as number), performs a WHOIS lookup using the external 'whoisAsn' function from 'whoiser' library, formats the result as text content, and handles errors appropriately.
    async ({ asn }) => { try { const result = await whoisAsn(asn); return { content: [{ type: 'text', text: `ASN 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_as' tool using Zod. Validates ASN as string matching 'AS' followed by digits (case-insensitive), then transforms it by removing 'AS' prefix and parsing to integer.
    { asn: z.string().regex(/^AS\d+$/i).transform(s => parseInt(s.slice(2))) },
  • src/index.ts:74-92 (registration)
    Registration of the 'whois_as' tool in the MCP server using server.tool(), including name, description, schema, and inline handler function.
    server.tool( 'whois_as', 'Looksup whois information about the Autonomous System Number (ASN)', { asn: z.string().regex(/^AS\d+$/i).transform(s => parseInt(s.slice(2))) }, async ({ asn }) => { try { const result = await whoisAsn(asn); return { content: [{ type: 'text', text: `ASN 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 }; } } );
Install Server

Other 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