Skip to main content
Glama
eva-wanxin-git

Windows Automation MCP Server

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
NameRequiredDescriptionDefault
titleYes窗口标题

Implementation Reference

  • 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 };
      }
    }
  • 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(),
    };
  • 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);
    }
  • 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}`);
      }
    }

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