whois_as
Retrieve detailed WHOIS information on Autonomous System Numbers (ASN) to identify ownership, registration dates, and related network details. Input a valid ASN format (e.g., AS12345) for precise results.
Instructions
Looksup whois information about the Autonomous System Number (ASN)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| asn | Yes |
Implementation Reference
- src/index.ts:78-91 (handler)The handler function for the 'whois_as' tool that executes the ASN WHOIS lookup by calling whoisAsn(asn) from the 'whoiser' library and returns formatted text response or error.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 }; } }
- src/index.ts:77-77 (schema)Zod input schema for the 'asn' parameter, validating format like 'AS123' and transforming 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 registerTools function using McpServer.tool method, specifying name, description, input 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 }; } } );