Usage
Description
Returns an array of all visible windows on the desktop. Each window includes its ID, title, application name, process ID, focus state, and optionally bounds.Parameters
Filter results to windows from a specific application (e.g., “Safari”, “Finder”)
Response
Response Fields
Each window object contains:id— Unique window identifier (use withfocus-window,resize-window, etc.)title— Current window titleapp_name— Application that owns this windowpid— Process IDis_focused— Whether this window currently has keyboard focusbounds— Window position and size (may be omitted)
Examples
List all visible windows
List windows for specific app
Get focused window
Count windows per app
Find window by title
Error Codes
PERM_DENIED— Missing Accessibility permissionAPP_NOT_FOUND— Specified app filter does not match any running application
Notes
- Only visible windows are included (minimized windows are excluded)
- Window IDs are stable within a session but may change after app restart
- On macOS, requires Accessibility permission
- Use the returned
idfield for window-specific commands likefocus-window,resize-window, etc.