thealeph_export_stats
Export network monitoring data in JSON or CSV format for analysis and reporting.
Instructions
Export all monitoring data in specified format
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Export format | json |
Implementation Reference
- src/tools.js:354-377 (handler)The primary handler function for the 'thealeph_export_stats' tool. It extracts the format parameter, calls the API client to export monitoring data, formats the response appropriately (markdown code block for JSON, raw for CSV), and handles errors./** * Export Stats Tool */ async exportStats(params) { try { const { format = 'json' } = params; const result = await this.client.exportMonitoringData(format); let response = `πΎ Exported Monitoring Data (${format.toUpperCase()})\n\n`; if (format === 'json') { response += '```json\n'; response += JSON.stringify(result, null, 2); response += '\n```'; } else { response += result; } return response; } catch (error) { return `β Failed to export monitoring data: ${error.message}`; } }
- src/tools.js:71-82 (schema)Input schema definition for the tool, specifying the optional 'format' parameter with enum ['json', 'csv'] and default 'json'.inputSchema: { type: 'object', properties: { format: { type: 'string', description: 'Export format', enum: ['json', 'csv'], default: 'json' } }, required: [] }
- src/tools.js:68-83 (registration)Tool registration entry in the getToolDefinitions() method, providing the name, description, and input schema for MCP server registration.{ 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: [] } },
- src/tools.js:236-237 (registration)Dispatcher case in executeTool method that routes calls to the exportStats handler.case 'thealeph_export_stats': return this.exportStats(params);
- src/client.js:99-106 (helper)API client helper method that makes the HTTP GET request to the /monitoring/stats/export endpoint with the format parameter./** * Export monitoring data */ async exportMonitoringData(format = 'json') { return this.makeRequest('GET', '/monitoring/stats/export', { params: { format } }); }