get_system_info
Retrieve system information with built-in security features, enabling safe and controlled access to directory operations within the Simple MCP Server.
Instructions
システム情報を取得します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:402-428 (handler)The main handler function for the 'get_system_info' tool. It gathers system information using Node.js 'os' module (platform, architecture, release, hostname, uptime, memory, CPUs, home dir, tmp dir) and returns it formatted as a JSON string in a CallToolResult.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:287-288 (registration)Registers the tool handler by dispatching 'get_system_info' calls to the getSystemInfo() method in the CallToolRequestSchema handler switch statement.case "get_system_info": return await this.getSystemInfo();
- src/index.ts:161-169 (schema)Tool schema definition in the TOOLS array, including name, description, and empty inputSchema (no parameters required). Used in ListToolsRequest response.{ name: "get_system_info", description: "システム情報を取得します", inputSchema: { type: "object", properties: {}, }, }, {