thealeph_asn_regex
Generate regex patterns to parse PTR records for a specific Autonomous System Number (ASN).
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. It takes the ASN parameter, calls the API client to fetch regex patterns, formats the response with markdown, and handles errors.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:101-109 (schema)Input schema definition for the tool, specifying that an 'asn' string parameter is required.inputSchema: { type: 'object', properties: { asn: { type: 'string', description: 'Autonomous System Number' } }, required: ['asn']
- src/tools.js:98-110 (registration)Tool registration in getToolDefinitions(), including name, description, and input schema.{ 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-241 (registration)Dispatch case in executeTool switch statement that routes to the asnRegex handler.case 'thealeph_asn_regex': return this.asnRegex(params);