kill_process
Terminate Windows processes by name to free system resources and resolve unresponsive applications. Optionally force close stubborn processes that won't exit normally.
Instructions
结束进程
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | 进程名称(如 notepad.exe) | |
| force | No | 是否强制结束(可选) |
Input Schema (JSON Schema)
{
"properties": {
"force": {
"description": "是否强制结束(可选)",
"type": "boolean"
},
"name": {
"description": "进程名称(如 notepad.exe)",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
Implementation Reference
- src/tools/process.js:97-105 (handler)The killProcess function implements the core logic for terminating a specified process using the Windows 'taskkill' command, supporting an optional force flag.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:28-35 (schema)Input schema defining the parameters for the kill_process tool: required 'name' string and optional 'force' boolean.inputSchema: { type: 'object', properties: { name: { type: 'string', description: '进程名称(如 notepad.exe)' }, force: { type: 'boolean', description: '是否强制结束(可选)' }, }, required: ['name'], },
- src/tools/process.js:25-36 (registration)Tool registration within getToolDefinitions(), including name, description, and 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 logic in executeTool method that routes kill_process calls to the handler.case 'kill_process': return await this.killProcess(args.name, args.force);