thealeph_daily_stats
Retrieve API usage statistics for a specific date from The Aleph MCP server to monitor network intelligence activity and track data consumption.
Instructions
Get API usage statistics for a specific date
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | Date in YYYY-MM-DD format |
Implementation Reference
- src/tools.js:308-328 (handler)The main handler function `dailyStats` that implements the core logic for the 'thealeph_daily_stats' tool: extracts the date parameter, calls the API client's getDailyStats method, formats the result into a markdown response with statistics for the specified date.async dailyStats(params) { try { const { date } = params; const result = await this.client.getDailyStats(date); let response = `π API Statistics for ${date}\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 daily statistics: ${error.message}`; } }
- src/tools.js:47-57 (schema)Input schema for the tool defining the required 'date' parameter as a string matching YYYY-MM-DD pattern.inputSchema: { type: 'object', properties: { date: { type: 'string', description: 'Date in YYYY-MM-DD format', pattern: '^\\d{4}-\\d{2}-\\d{2}$' } }, required: ['date'] }
- src/tools.js:44-58 (registration)Registration of the tool in the MCP getToolDefinitions() array, including name, description, and input schema.{ 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'] } },
- src/tools.js:232-233 (registration)Registration in the executeTool switch statement dispatching 'thealeph_daily_stats' to the dailyStats handler.case 'thealeph_daily_stats': return this.dailyStats(params);
- src/client.js:88-90 (helper)Supporting API client method `getDailyStats(date)` that performs the HTTP GET request to the /monitoring/stats/daily/{date} endpoint.async getDailyStats(date) { return this.makeRequest('GET', `/monitoring/stats/daily/${date}`); }