getLoadAverage
Retrieve system load averages for 1, 5, and 15-minute intervals to monitor server performance and resource utilization. Provides critical metrics for effective system management and troubleshooting.
Instructions
Get system load average for 1, 5, and 15 minutes
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/system.ts:78-91 (handler)The handler function for the 'getLoadAverage' tool that retrieves the system load averages for 1, 5, and 15 minutes using Node.js os.loadavg() and returns them formatted as JSON.handler: async () => { const [oneMin, fiveMin, fifteenMin] = os.loadavg(); return { content: [{ type: 'text', text: JSON.stringify({ oneMinute: oneMin, fiveMinutes: fiveMin, fifteenMinutes: fifteenMin }, null, 2) }] }; }
- src/tools/system.ts:71-77 (schema)Tool schema definition including name, description, and empty inputSchema (no parameters required).getLoadAverage: { name: 'getLoadAverage', description: 'Get system load average for 1, 5, and 15 minutes', inputSchema: { type: 'object', properties: {} },
- src/index.ts:28-35 (registration)Registration of systemTools (containing getLoadAverage) into the allTools object, which is used for listing and executing MCP tools.const allTools: ToolKit = { ...systemTools, ...networkTools, ...geoTools, ...generatorTools, ...dateTimeTools, ...securityTools };
- src/index.ts:5-5 (registration)Import of systemTools, which includes the getLoadAverage tool definition.import { systemTools } from './tools/system.js';