thealeph_asn_infrastructure_mapping
Map infrastructure locations for an Autonomous System Number to identify 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 that executes the tool: extracts ASN, calls client API, formats response with infrastructure locations or error message.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)Input schema definition for the tool in getToolDefinitions(), specifying required 'asn' string parameter.{ 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() that maps tool name to the 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 GET request to the /api/asn/{asn}/infrastructure_mapping endpoint.async getASNInfrastructureMapping(asn) { return this.makeRequest('GET', `/api/asn/${asn}/infrastructure_mapping`); }
- src/tools.js:16-220 (registration)The getToolDefinitions method registers all MCP tools including this one by returning their definitions.getToolDefinitions() { return [ { name: 'thealeph_health_check', description: 'Check the health and operational status of The Aleph API', inputSchema: { type: 'object', properties: {}, required: [] } }, { name: 'thealeph_current_stats', description: 'Get current API usage statistics for the last N days', inputSchema: { type: 'object', properties: { days: { type: 'integer', description: 'Number of days to retrieve statistics for (1-30)', minimum: 1, maximum: 30, default: 1 } }, required: [] } }, { name: 'thealeph_daily_stats', description: 'Get API usage statistics for a specific date', inputSchema: { type: 'object', properties: { date: { type: 'string', description: 'Date in YYYY-MM-DD format', pattern: '^\\d{4}-\\d{2}-\\d{2}$' } }, required: ['date'] } }, { name: 'thealeph_summary_stats', description: 'Get a quick summary of API usage statistics', inputSchema: { type: 'object', properties: {}, required: [] } }, { name: 'thealeph_export_stats', description: 'Export all monitoring data in specified format', inputSchema: { type: 'object', properties: { format: { type: 'string', description: 'Export format', enum: ['json', 'csv'], default: 'json' } }, required: [] } }, { name: 'thealeph_asn_classifications', description: 'Get classification information for a specific ASN', inputSchema: { type: 'object', properties: { asn: { type: 'string', description: 'Autonomous System Number (e.g., "15169" for Google)' } }, required: ['asn'] } }, { 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'] } }, { name: 'thealeph_asn_hints', description: 'Get geographic and network hints for an ASN', inputSchema: { type: 'object', properties: { asn: { type: 'string', description: 'Autonomous System Number' } }, required: ['asn'] } }, { 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'] } }, { name: 'thealeph_asn_hint_mapping', description: 'Get hint-based location mapping for an ASN', inputSchema: { type: 'object', properties: { asn: { type: 'string', description: 'Autonomous System Number' } }, required: ['asn'] } }, { name: 'thealeph_query_ptr', description: 'Query reverse DNS (PTR) records and retrieve network intelligence including ASN, location, and geo hints', inputSchema: { type: 'object', properties: { ptr_record: { type: 'string', description: 'PTR record hostname to query' }, ip: { type: 'string', description: 'IP address to query' }, asn: { type: 'integer', description: 'ASN number to query' } }, required: [] } }, { name: 'thealeph_batch_query_ptr', description: 'Query multiple PTR records in a single batch request', inputSchema: { type: 'object', properties: { queries: { type: 'array', description: 'Array of query objects, each with optional ptr_record, ip, and/or asn', items: { type: 'object', properties: { ptr_record: { type: 'string' }, ip: { type: 'string' }, asn: { type: 'integer' } } }, minItems: 1, maxItems: 100 } }, required: ['queries'] } }, { name: 'thealeph_traceroute_mapper', description: 'Enrich traceroute hops with network intelligence including ASN, PTR records, and geographic locations', inputSchema: { type: 'object', properties: { traceroute: { type: 'string', description: 'Traceroute output as a string' }, mode: { type: 'string', description: 'Traceroute format mode', enum: ['string', 'RIPE'], default: 'string' } }, required: ['traceroute'] } } ];