get_system_info
Retrieve Windows system information including hardware specifications, OS details, and performance metrics for monitoring and automation tasks.
Instructions
获取系统信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/powershell.js:125-154 (handler)The main handler function for 'get_system_info' that executes PowerShell commands to gather system details including OS, computer model, memory, and CPU information, parses the JSON output, and returns it in a success/error structure.async getSystemInfo() { try { const command = ` $os = Get-CimInstance Win32_OperatingSystem $cs = Get-CimInstance Win32_ComputerSystem $cpu = Get-CimInstance Win32_Processor @{ ComputerName = $cs.Name OS = $os.Caption Version = $os.Version Architecture = $os.OSArchitecture Manufacturer = $cs.Manufacturer Model = $cs.Model TotalMemoryGB = [math]::Round($cs.TotalPhysicalMemory / 1GB, 2) CPU = $cpu.Name CPUCores = $cpu.NumberOfCores CPULogical = $cpu.NumberOfLogicalProcessors } | ConvertTo-Json `; const { stdout } = await execAsync(`powershell -Command "${command.replace(/"/g, '\\"')}"`, { shell: 'powershell.exe' }); const info = JSON.parse(stdout); return { success: true, info }; } catch (error) { return { success: false, error: error.message }; } }
- src/tools/powershell.js:36-43 (schema)Tool schema definition including name, description, and empty input schema (no parameters required).{ name: 'get_system_info', description: '获取系统信息', inputSchema: { type: 'object', properties: {}, }, },
- src/tools/powershell.js:75-76 (registration)Registration and dispatch logic in the executeTool switch statement that routes calls to the getSystemInfo handler.case 'get_system_info': return await this.getSystemInfo();