thealeph_asn_regex
Generate regex patterns for parsing PTR records from a specific Autonomous System Number (ASN) to analyze network infrastructure and DNS configurations.
Instructions
Get regex patterns associated with an ASN for PTR record parsing
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| asn | Yes | Autonomous System Number |
Implementation Reference
- src/tools.js:407-434 (handler)The main handler function for the 'thealeph_asn_regex' tool. Extracts ASN from params, calls the client API, formats the regex patterns response with markdown.async asnRegex(params) { try { const { asn } = params; const result = await this.client.getASNRegex(asn); let response = `🔍 Regex Patterns for ASN ${asn}\n\n`; if (typeof result === 'object' && Object.keys(result).length > 0) { for (const [key, value] of Object.entries(result)) { if (Array.isArray(value)) { response += `**${key}:**\n`; value.forEach((pattern, idx) => { response += ` ${idx + 1}. \`${pattern}\`\n`; }); } else { response += `**${key}:** \`${value}\`\n`; } } } else { response += 'No regex patterns available for this ASN.'; } return response; } catch (error) { return `❌ Failed to retrieve ASN regex patterns: ${error.message}`; } }
- src/tools.js:98-110 (schema)Input schema definition and tool metadata for 'thealeph_asn_regex' in the tool definitions array.{ name: 'thealeph_asn_regex', description: 'Get regex patterns associated with an ASN for PTR record parsing', inputSchema: { type: 'object', properties: { asn: { type: 'string', description: 'Autonomous System Number' } }, required: ['asn'] }
- src/tools.js:240-240 (registration)Registration/dispatch case in the executeTool switch statement that routes to the asnRegex handler.case 'thealeph_asn_regex':
- src/client.js:118-120 (helper)API client helper method that makes the HTTP GET request to retrieve regex patterns for the given ASN.async getASNRegex(asn) { return this.makeRequest('GET', `/api/asn/${asn}/regex`); }