ui_toggle
Toggle a checkbox or toggle button via UI Automation and return its new state, providing reliable feedback instead of click simulation.
Instructions
Toggle a CheckBox or ToggleButton using UIA TogglePattern.
Returns the new toggle state after the operation: "On", "Off", or "Indeterminate". Use this instead of ui_click for checkboxes to get reliable state feedback.
Note: If app is STOPPED at breakpoint, resume with continue_execution() first.
Args: automation_id: AutomationId property name: Element's Name/Title property control_type: Control type (CheckBox, ToggleButton, etc.) root_id: Optional AutomationId to scope search to a subtree xpath: Optional XPath expression (FlaUI backend 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_toggle"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| xpath | No | ||
| root_id | No | ||
| control_type | No | ||
| automation_id | No |