get_process_info
Retrieve detailed process information from Windows systems to monitor application status, identify running services, and manage system resources effectively.
Instructions
获取进程详细信息
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | 进程名称 |
Input Schema (JSON Schema)
{
"properties": {
"name": {
"description": "进程名称",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
Implementation Reference
- src/tools/process.js:130-154 (handler)The main handler function that retrieves detailed process information (PID, session, memory, status, username, window title) using the Windows 'tasklist' command with CSV and verbose output, parsing the first matching process.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-57 (schema)The tool schema definition, specifying the name, description, and input schema requiring a 'name' string for the process.{ name: 'get_process_info', description: '获取进程详细信息', inputSchema: { type: 'object', properties: { name: { type: 'string', description: '进程名称' }, }, required: ['name'], }, },
- src/tools/process.js:74-75 (registration)The dispatch case in executeTool method that routes 'get_process_info' calls to the getProcessInfo handler.case 'get_process_info': return await this.getProcessInfo(args.name);
- src/tools/process.js:62-62 (registration)The tools array in canHandle method that includes 'get_process_info' for capability checking.const tools = ['launch_application', 'kill_process', 'list_processes', 'get_process_info'];