thealeph_current_stats
Retrieve API usage statistics for the specified number of days to monitor network intelligence tool performance and track resource consumption.
Instructions
Get current API usage statistics for the last N days
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Number of days to retrieve statistics for (1-30) |
Implementation Reference
- src/tools.js:283-303 (handler)The handler function that implements the core logic for the 'thealeph_current_stats' tool. Extracts the 'days' parameter, fetches data from the API client, and formats a markdown-formatted response with the statistics.async currentStats(params) { try { const { days = 1 } = params; const result = await this.client.getCurrentStats(days); let response = `π The Aleph API Statistics (Last ${days} day${days > 1 ? 's' : ''})\n\n`; if (typeof result === 'object') { for (const [key, value] of Object.entries(result)) { response += `**${key}:** ${JSON.stringify(value, null, 2)}\n`; } } else { response += `${JSON.stringify(result, null, 2)}`; } return response; } catch (error) { return `β Failed to retrieve current statistics: ${error.message}`; } }
- src/tools.js:30-42 (schema)The JSON schema defining the input parameters for the tool, specifying the optional 'days' integer parameter with validation constraints.inputSchema: { type: 'object', properties: { days: { type: 'integer', description: 'Number of days to retrieve statistics for (1-30)', minimum: 1, maximum: 30, default: 1 } }, required: [] }
- src/tools.js:230-231 (registration)The registration/mapping of the tool name to its handler function within the central executeTool switch statement.case 'thealeph_current_stats': return this.currentStats(params);
- src/client.js:79-83 (helper)Supporting API client method that makes the HTTP request to the backend endpoint /monitoring/stats/current to retrieve the raw statistics data.async getCurrentStats(days = 1) { return this.makeRequest('GET', '/monitoring/stats/current', { params: { days } }); }