get_system_info
Retrieve system information from Windows computers to monitor hardware specifications, software details, and system configuration for automation and management tasks.
Instructions
获取系统信息
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/tools/powershell.js:125-154 (handler)Executes PowerShell script using Get-CimInstance to retrieve comprehensive system information including OS details, computer system, CPU, and memory, then parses and returns as JSON.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 (registration)Registers the get_system_info tool in the getToolDefinitions() method, including name, description, and empty input schema.{ name: 'get_system_info', description: '获取系统信息', inputSchema: { type: 'object', properties: {}, }, },
- src/tools/powershell.js:75-76 (registration)Dispatches to the getSystemInfo handler in the executeTool switch statement.case 'get_system_info': return await this.getSystemInfo();
- src/tools/powershell.js:64-65 (registration)Includes 'get_system_info' in the list of handleable tools for canHandle method.const tools = ['run_powershell', 'run_cmd', 'get_system_info', 'get_disk_info', 'get_network_info'];