thealeph_asn_infrastructure_mapping
Map infrastructure locations for an Autonomous System Number to visualize network assets and their geographical distribution.
Instructions
Map infrastructure locations for an ASN
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| asn | Yes | Autonomous System Number |
Implementation Reference
- src/tools.js:464-488 (handler)Main handler function executing the tool: extracts ASN, fetches data via client, formats response with location details or error.async asnInfrastructureMapping(params) { try { const { asn } = params; const result = await this.client.getASNInfrastructureMapping(asn); let response = `🗺️ Infrastructure Mapping for ASN ${asn}\n\n`; if (Array.isArray(result) && result.length > 0) { result.forEach((location, idx) => { response += `**Location ${idx + 1}:**\n`; for (const [key, value] of Object.entries(location)) { response += ` - ${key}: ${value}\n`; } response += '\n'; }); } else { response += 'No infrastructure mapping available for this ASN.'; } return response; } catch (error) { return `❌ Failed to retrieve infrastructure mapping: ${error.message}`; } }
- src/tools.js:126-139 (schema)Tool definition including name, description, and input schema requiring 'asn' as string.{ name: 'thealeph_asn_infrastructure_mapping', description: 'Map infrastructure locations for an ASN', inputSchema: { type: 'object', properties: { asn: { type: 'string', description: 'Autonomous System Number' } }, required: ['asn'] } },
- src/tools.js:244-245 (registration)Switch case registration in executeTool method that dispatches to the specific handler function.case 'thealeph_asn_infrastructure_mapping': return this.asnInfrastructureMapping(params);
- src/client.js:132-134 (helper)API client helper method that performs the HTTP request to the Aleph API endpoint for ASN infrastructure mapping.async getASNInfrastructureMapping(asn) { return this.makeRequest('GET', `/api/asn/${asn}/infrastructure_mapping`); }