get_system_info
Retrieve system information such as hardware specs, OS details, and performance metrics to monitor device status and troubleshoot issues.
Instructions
システム情報を取得します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:402-428 (handler)The core handler function for the 'get_system_info' tool. It collects various system metrics using Node.js 'os' module including platform, architecture, OS release, hostname, uptime (in hours), total/free memory (in GB), CPU count, home directory, and temp directory. Formats the info as JSON and returns it wrapped in CallToolResult with text content.private async getSystemInfo(): Promise<CallToolResult> { console.error("Getting system info"); const info = { platform: os.platform(), arch: os.arch(), release: os.release(), hostname: os.hostname(), uptime: `${Math.floor(os.uptime() / 3600)}時間`, memory: { total: `${Math.round(os.totalmem() / 1024 / 1024 / 1024)}GB`, free: `${Math.round(os.freemem() / 1024 / 1024 / 1024)}GB`, }, cpus: os.cpus().length, homeDir: os.homedir(), tmpDir: os.tmpdir(), }; return { content: [ { type: "text", text: `システム情報:\n\n${JSON.stringify(info, null, 2)}`, }, ], isError: false, }; }
- src/index.ts:161-168 (registration)Registration of the 'get_system_info' tool in the TOOLS constant array used by ListToolsRequestSchema handler. Defines the tool name, Japanese description ('Obtains system information'), and empty inputSchema (no parameters required).{ name: "get_system_info", description: "システム情報を取得します", inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:287-288 (registration)Dispatch/registration logic in the switch statement of CallToolRequestSchema handler. Routes calls to 'get_system_info' by invoking the private getSystemInfo() method.case "get_system_info": return await this.getSystemInfo();