minimize_window
Minimize a specific window by its title to declutter your desktop and focus on other tasks using Windows Automation MCP Server.
Instructions
最小化窗口
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | 窗口标题 |
Implementation Reference
- src/tools/window.js:220-232 (handler)The handler function for minimize_window tool. It executes PowerShell script using Shell.Application.MinimizeAll() to minimize all windows (note: ignores specific title).async minimizeWindow(title) { try { const script = ` $shell = New-Object -ComObject Shell.Application $shell.MinimizeAll() `; await execAsync(`powershell -Command "${script}"`, { shell: 'powershell.exe' }); return { success: true, window: title, message: '窗口已最小化' }; } catch (error) { return { success: false, error: error.message }; } }
- src/tools/window.js:52-62 (schema)Input schema definition for the 'minimize_window' tool, specifying required 'title' parameter.{ name: 'minimize_window', description: '最小化窗口', inputSchema: { type: 'object', properties: { title: { type: 'string', description: '窗口标题' }, }, required: ['title'], }, },
- src/server.js:43-52 (registration)Registration of WindowTools instance in the main tools map, enabling dynamic tool discovery and execution via getToolDefinitions() and canHandle().this.tools = { filesystem: new FileSystemTools(), process: new ProcessTools(), mouseKeyboard: new MouseKeyboardTools(), window: new WindowTools(), screen: new ScreenTools(), clipboard: new ClipboardTools(), powershell: new PowerShellTools(), browser: new BrowserTools(), };
- src/tools/window.js:77-81 (registration)canHandle method registers 'minimize_window' as a supported tool name for routing.canHandle(toolName) { const tools = ['list_windows', 'get_active_window', 'activate_window', 'close_window', 'minimize_window', 'maximize_window']; return tools.includes(toolName); }
- src/tools/window.js:93-100 (helper)Dispatch case in executeTool that routes 'minimize_window' calls to the handler.case 'minimize_window': return await this.minimizeWindow(args.title); case 'maximize_window': return await this.maximizeWindow(args.title); default: throw new Error(`未知工具: ${name}`); } }