## Description Implement window management MCP tools to allow AI assistants to interact with Visual Studio windows. ## Tools to Implement ### `window_list` (ReadOnly) List all open windows (both document and tool windows). **Returns:** List of `WindowInfo` objects with: - `Caption` - Window title - `Kind` - "Document" or "Tool" - `IsVisible` - Whether the window is currently visible - `ObjectKind` - The window's GUID (for reference) ### `window_activate` Activate/focus a specific window by caption/name. **Parameters:** - `caption` (string) - The window caption to activate ### `toolwindow_show` Show a tool window by well-known name. Accepts a predefined friendly name mapped to `View.*` DTE commands. **Parameters:** - `name` (string) - Well-known tool window name **Supported tool windows:** | Name | DTE Command | |------|------------| | `SolutionExplorer` | `View.SolutionExplorer` | | `ErrorList` | `View.ErrorList` | | `Output` | `View.Output` | | `TeamExplorer` | `View.TeamExplorer` | | `Terminal` | `View.Terminal` | | `TaskList` | `View.TaskList` | | `Properties` | `View.PropertiesWindow` | | `Toolbox` | `View.Toolbox` | | `FindResults` | `View.FindResults1` | | `Bookmarks` | `View.BookmarkWindow` | Returns the list of supported names if given an invalid one. ### `toolwindow_hide` Hide/close a tool window by caption. **Parameters:** - `caption` (string) - The tool window caption to hide ## VS APIs - `DTE2.Windows` - Enumerate windows - `Window.Activate()` - Focus a window - `Window.Close()` - Hide/close a window - `DTE2.ExecuteCommand()` - Show tool windows via `View.*` commands ## Implementation Notes - Use friendly names instead of GUIDs for `toolwindow_show` (AI assistants can reason about names, not GUIDs) - Map well-known names to DTE commands internally - Return helpful error with list of valid names when an invalid name is provided - Window kind detection: use `Window.Kind` or `Window.ObjectKind` to distinguish document vs tool windows
Activity