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

  • Handler function for the 'whois_as' MCP tool that performs whois lookup for an ASN by calling whoisAsn(asn) and formatting the result as text content.
    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 to validate and parse the ASN parameter.
    { 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 on the MCP server using server.tool() with name, description, schema, and handler.
    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 }; } } );

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/modelcontextprotocol-servers/whois-mcp'

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