thealeph_traceroute_mapper
Enrich traceroute data with network intelligence including ASN, PTR records, and geographic locations to analyze network paths and identify infrastructure details.
Instructions
Enrich traceroute hops with network intelligence including ASN, PTR records, and geographic locations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| traceroute | Yes | Traceroute output as a string | |
| mode | No | Traceroute format mode | string |
Implementation Reference
- src/tools.js:600-628 (handler)The handler function that implements the core logic of the 'thealeph_traceroute_mapper' tool. It parses input parameters, calls the API client's mapTraceroute method, processes the result into a formatted Markdown response listing enriched traceroute hops with IP, ASN, PTR, and location info, and handles errors.async tracerouteMapper(params) { try { const { traceroute, mode = 'string' } = params; const result = await this.client.mapTraceroute(traceroute, mode); let response = `🛤️ Traceroute Mapping Results (${mode} mode)\n\n`; if (Array.isArray(result)) { result.forEach((hop, idx) => { response += `**Hop ${idx + 1}:**\n`; if (hop.ip) response += ` - IP: ${hop.ip}\n`; if (hop.asn) response += ` - ASN: ${hop.asn}\n`; if (hop.ptr) response += ` - PTR: ${hop.ptr}\n`; if (hop.location) { response += ` - Location: ${JSON.stringify(hop.location)}\n`; } response += '\n'; }); } else { response += JSON.stringify(result, null, 2); } return response; } catch (error) { return `❌ Traceroute mapping failed: ${error.message}`; } }
- src/tools.js:200-219 (schema)The input schema definition for the tool, specifying the expected parameters: traceroute (required string) and optional mode (enum: 'string', 'RIPE').{ 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'] } }
- src/tools.js:252-253 (registration)Registration of the tool handler in the central executeTool switch statement, mapping the tool name to its handler function.case 'thealeph_traceroute_mapper': return this.tracerouteMapper(params);
- src/client.js:167-171 (helper)API client helper method that sends the traceroute data to the backend API endpoint '/api/traceroute_mapper' via POST request.async mapTraceroute(traceroute, mode = 'string') { return this.makeRequest('POST', '/api/traceroute_mapper', { data: { traceroute, mode } }); }