getLoadAverage
Monitor system performance by retrieving load averages for 1, 5, and 15-minute intervals to assess CPU utilization and resource demands.
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 main handler function for the getLoadAverage tool. It calls os.loadavg() to retrieve the 1, 5, and 15-minute load averages and formats them as JSON in the MCP response content.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 metadata including name, description, and input schema (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)Registers the getLoadAverage tool by spreading systemTools into the allTools object, which is used by the MCP server's listTools and callTool request handlers.const allTools: ToolKit = { ...systemTools, ...networkTools, ...geoTools, ...generatorTools, ...dateTimeTools, ...securityTools };
- src/index.ts:5-5 (registration)Imports the systemTools object containing the getLoadAverage tool definition.import { systemTools } from './tools/system.js';