ui_set_focus
Sets keyboard focus to a target UI element so subsequent keystrokes reach the correct control.
Instructions
Set keyboard focus to a UI element.
Uses UIA-based Focus() for FlaUI backend (monitor/DPI-agnostic), or element search + set_focus for pywinauto backend.
Call this before ui_send_keys to ensure keys go to the right element.
Args: automation_id: AutomationId property (FlaUI + pywinauto) name: Element's Name/Title property (FlaUI + pywinauto) control_type: Control type (pywinauto only) root_id: Optional AutomationId to scope search (pywinauto only) xpath: Optional XPath expression (pywinauto only)
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": "ui_set_focus"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| xpath | No | ||
| root_id | No | ||
| control_type | No | ||
| automation_id | No |