getSystemInfo
Retrieve system information such as OS details, CPU architecture, memory usage, and network interfaces for monitoring and diagnostics.
Instructions
Get system information using Node.js os module
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/system.ts:51-68 (handler)Handler function that gathers system information (platform, architecture, CPU count, memory, uptime, Node version) using Node.js 'os' module and returns 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 the 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 all tools including systemTools (which contains getSystemInfo) into the allTools object used by the MCP server handlers for listing and execution.
const allTools: ToolKit = { ...systemTools, ...networkTools, ...geoTools, ...generatorTools, ...dateTimeTools, ...securityTools }; - src/tools/system.ts:44-69 (registration)Definition and export of the getSystemInfo tool within the systemTools object, including name, description, input schema, and handler.
getSystemInfo: { name: 'getSystemInfo', description: 'Get system information using Node.js os module', inputSchema: { type: 'object', properties: {} }, 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) }] }; } },