thealeph_asn_classifications
Retrieve classification details for Autonomous System Numbers to analyze network infrastructure and identify organizational ownership.
Instructions
Get classification information for a specific ASN
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| asn | Yes | Autonomous System Number (e.g., "15169" for Google) |
Implementation Reference
- src/tools.js:382-402 (handler)Main handler function that executes the 'thealeph_asn_classifications' tool logic, extracts ASN parameter, calls the API client, and formats the classifications response.async asnClassifications(params) { try { const { asn } = params; const result = await this.client.getASNClassifications(asn); let response = `🏷️ Classifications for ASN ${asn}\n\n`; if (typeof result === 'object' && Object.keys(result).length > 0) { for (const [key, value] of Object.entries(result)) { response += `**${key}:** ${JSON.stringify(value, null, 2)}\n`; } } else { response += 'No classification data available for this ASN.'; } return response; } catch (error) { return `❌ Failed to retrieve ASN classifications: ${error.message}`; } }
- src/tools.js:84-97 (schema)Tool schema definition including name, description, and input schema requiring 'asn' as a string.{ 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'] } },
- src/tools.js:238-239 (registration)Registration of the tool handler in the executeTool switch statement dispatcher.case 'thealeph_asn_classifications': return this.asnClassifications(params);
- src/client.js:111-113 (handler)Core API handler in the client that performs the HTTP GET request to retrieve ASN classifications from the Aleph API.async getASNClassifications(asn) { return this.makeRequest('GET', `/api/asn/${asn}/classifications`); }
- src/client.js:47-67 (helper)Helper method used by all API calls, including getASNClassifications, providing HTTP request execution with retry logic and error handling.async makeRequest(method, endpoint, options = {}) { for (let attempt = 1; attempt <= this.retryAttempts; attempt++) { try { const response = await this.axios.request({ method, url: endpoint, ...options }); return response.data; } catch (error) { if (attempt === this.retryAttempts) { throw error; } // Wait before retry (exponential backoff) await new Promise(resolve => setTimeout(resolve, this.retryDelay * Math.pow(2, attempt - 1)) ); } } }