focus_window
Focus any macOS window by app name, window ID, or window index, with automatic fallback to frontmost.
Instructions
Focus a macOS window by window id, app name, or frontmost fallback.
Args: app_name: Optional app name, bundle id, or process name window_id: Optional CoreGraphics window id window_index: Optional 1-based index among the app's windows
Returns: JSON string with focused window metadata, or an error message.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "focus_window"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_name | No | ||
| window_id | No | ||
| window_index | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |