Skip to main content
Glama

list_windows

Identify and filter visible application windows by title to target specific processes for game hacking and reverse engineering tasks.

Instructions

List all visible windows. Args: filter_name: Optional filter to match window titles (case-insensitive) Returns: List of windows with handle, title, and associated PID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filter_nameNo

Implementation Reference

  • The handler function for the 'list_windows' MCP tool. Enumerates all visible top-level windows using win32gui.EnumWindows, filters by title if specified, retrieves PID and window geometry, and returns a structured list of windows.
    @mcp.tool() def list_windows(filter_name: str = "") -> Dict[str, Any]: """ List all visible windows. Args: filter_name: Optional filter to match window titles (case-insensitive) Returns: List of windows with handle, title, and associated PID. """ if not SCREENSHOT_AVAILABLE: return {"error": "Screenshot support not available. Install: pip install pywin32 pillow"} windows = [] def enum_callback(hwnd, _): if win32gui.IsWindowVisible(hwnd): title = win32gui.GetWindowText(hwnd) if title: if filter_name and filter_name.lower() not in title.lower(): return True try: _, pid = win32process.GetWindowThreadProcessId(hwnd) rect = win32gui.GetWindowRect(hwnd) width = rect[2] - rect[0] height = rect[3] - rect[1] if width > 0 and height > 0: windows.append({ "hwnd": hwnd, "title": title, "pid": pid, "x": rect[0], "y": rect[1], "width": width, "height": height }) except: pass return True try: win32gui.EnumWindows(enum_callback, None) return {"count": len(windows), "windows": windows} except Exception as e: return {"error": f"Failed to enumerate windows: {str(e)}"}
  • The 'list_windows' tool is registered and listed in the capabilities under the 'window_interaction' category in the list_capabilities tool.
    "window_interaction": [ "list_windows", "screenshot_window", "screenshot_screen", "send_key_to_window", "focus_window" ],

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/0xhackerfren/frida-game-hacking-mcp'

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