get_process_info
Retrieve detailed information about running Windows processes to monitor system activity, identify resource usage, and manage applications effectively.
Instructions
获取进程详细信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | 进程名称 |
Implementation Reference
- src/tools/process.js:130-154 (handler)The handler function that executes the tool logic: queries Windows tasklist for process details, parses CSV output, and returns structured info including PID, memory, status, username, and window title.async getProcessInfo(processName) { try { const { stdout } = await execAsync(`tasklist /FI "IMAGENAME eq ${processName}" /FO CSV /V`); const lines = stdout.trim().split('\n'); if (lines.length < 2) { return { success: false, message: '进程未找到' }; } const info = lines[1].split(',').map(p => p.replace(/"/g, '')); return { success: true, process: { name: info[0], pid: info[1], session: info[2], memory: info[4], status: info[5], username: info[6], windowTitle: info[8], }, }; } catch (error) { return { success: false, error: error.message }; } }
- src/tools/process.js:47-58 (schema)Input schema definition for the get_process_info tool, specifying required 'name' parameter as string.{ name: 'get_process_info', description: '获取进程详细信息', inputSchema: { type: 'object', properties: { name: { type: 'string', description: '进程名称' }, }, required: ['name'], }, }, ];
- src/tools/process.js:74-75 (registration)Tool registration in the executeTool method's switch statement, dispatching calls to the getProcessInfo handler.case 'get_process_info': return await this.getProcessInfo(args.name);
- src/tools/process.js:62-62 (registration)Tool name listed in canHandle method for routing tool calls to this module.const tools = ['launch_application', 'kill_process', 'list_processes', 'get_process_info'];