Skip to main content
Glama

Windows Automation MCP Server

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

NameRequiredDescriptionDefault
nameYes进程名称(如 notepad.exe)
forceNo是否强制结束(可选)

Input Schema (JSON Schema)

{ "properties": { "force": { "description": "是否强制结束(可选)", "type": "boolean" }, "name": { "description": "进程名称(如 notepad.exe)", "type": "string" } }, "required": [ "name" ], "type": "object" }

Implementation Reference

  • 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 }; } }
  • 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'], },
  • 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'], }, },
  • Dispatch logic in executeTool method that routes kill_process calls to the handler.
    case 'kill_process': return await this.killProcess(args.name, args.force);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/eva-wanxin-git/windows-automation-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server