getSystemInfo
Retrieve detailed system information, including OS, memory, and CPU details, using the Node.js os module. Ideal for monitoring and diagnostics within the Toolkit MCP Server.
Instructions
Get system information using Node.js os module
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/system.ts:51-68 (handler)The handler function that executes the getSystemInfo tool logic, gathering system information using Node.js 'os' module and returning it as formatted JSON.handler: async () => { const info: SystemInfo = { platform: os.platform(), arch: os.arch(), cpus: os.cpus().length, totalMemory: os.totalmem(), freeMemory: os.freemem(), uptime: os.uptime(), nodeVersion: process.version }; return { content: [{ type: 'text', text: JSON.stringify(info, null, 2) }] }; }
- src/types.ts:36-44 (schema)TypeScript interface defining the structure of system information returned by the getSystemInfo tool.export interface SystemInfo { platform: string; arch: string; cpus: number; totalMemory: number; freeMemory: number; uptime: number; nodeVersion: string; }
- src/index.ts:28-35 (registration)Registration of systemTools (which includes getSystemInfo) into the allTools object used by the MCP server for tool listing and execution.const allTools: ToolKit = { ...systemTools, ...networkTools, ...geoTools, ...generatorTools, ...dateTimeTools, ...securityTools };
- src/tools/system.ts:47-50 (schema)Input schema for getSystemInfo tool, which takes no parameters.inputSchema: { type: 'object', properties: {} },
- src/index.ts:5-5 (registration)Import of systemTools containing the getSystemInfo tool definition.import { systemTools } from './tools/system.js';