kill_process
Terminate Windows processes by name to free system resources or stop unresponsive applications. Optionally force close stubborn processes.
Instructions
结束进程
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | 进程名称(如 notepad.exe) | |
| force | No | 是否强制结束(可选) |
Implementation Reference
- src/tools/process.js:97-105 (handler)The main handler function that executes the process killing logic using taskkill.async killProcess(processName, force = false) { try { const flag = force ? '/F' : ''; await execAsync(`taskkill ${flag} /IM "${processName}"`); return { success: true, process: processName, message: '进程已结束' }; } catch (error) { return { success: false, error: error.message }; } }
- src/tools/process.js:25-36 (schema)Tool definition with input schema for kill_process.{ name: 'kill_process', description: '结束进程', inputSchema: { type: 'object', properties: { name: { type: 'string', description: '进程名称(如 notepad.exe)' }, force: { type: 'boolean', description: '是否强制结束(可选)' }, }, required: ['name'], }, },
- src/tools/process.js:70-71 (registration)Dispatch in executeTool method routing kill_process to handler.case 'kill_process': return await this.killProcess(args.name, args.force);
- src/tools/process.js:62-62 (registration)kill_process listed in supported tools for canHandle method.const tools = ['launch_application', 'kill_process', 'list_processes', 'get_process_info'];