whois_as
Retrieve WHOIS information for an Autonomous System Number (ASN) to identify ownership, registration details, and related network data efficiently.
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)Handler function that performs the ASN whois lookup using the imported whoisAsn function, handles errors, and returns formatted 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 }; } }
- src/index.ts:77-77 (schema)Input schema validating ASN as string matching /^AS\d+$/i pattern and transforming to integer by parsing the number after 'AS'.{ asn: z.string().regex(/^AS\d+$/i).transform(s => parseInt(s.slice(2))) },
- src/index.ts:74-92 (registration)Registers the 'whois_as' tool on the MCP server with name, description, input schema, and 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 }; } } );