element_action
Act on a control of a virtual machine.
Acts on an element by a ref from screen_elements, through UI Automation in Windows, AX in macOS and AT-SPI on a Linux desktop, without keys or clicks: invoke presses a button or a menu item, or else toggles, selects or expands it; toggle, expand, collapse and select use their own pattern; set_value puts value in a field, or a number in a slider; focus gives it the keyboard focus; scroll_into_view scrolls it into view. It says whether the effect was verified, and shows the element after. A ref whose element changed or went fails as stale: read the elements again.
- Profiles
- operator, full
- Read-only
- No
- Destructive
- Yes
- Idempotent
- No
- Open world
- Yes
- Runs as a task
- No
Parameters
actionstringRequiredWhat to do.
One of
invoke,toggle,expand,collapse,select,set_value,focus,scroll_into_view.coordinate_spacestringdisplay: pixels of what the display shows now (default). screenshot: pixels of a scaled screenshot screenshot_width wide. normalized_1000: 0 to 999 across each side.
One of
display,screenshot,normalized_1000.refstringRequiredA ref from screen_elements, such as kqzxw41.
screenshot_widthintegerThe width of the screenshot the coordinates are in.
From 1 to 8192.
timeout_secondsintegerSeconds the guest may take; default 5.
From 1 to 20.
valuestringFor set_value: the text, or the number.
vmstringRequiredThe machine's name or identifier, as vm_list shows it.
Output
The result's structured content is an object with these fields.
JSON Schema: /schemas/0/mcp/tools/element_action/output.json
answeredbooleanRequiredcoordinateSpacestringRequiredOne of
display,screenshot,normalized_1000.effectstringRequiredOne of
changed,unchanged,gone,unknown.elementobjectelement.guestDataarray of objectsRequiredpatternstringRequiredOne of
Invoke,Toggle,SelectionItem,ExpandCollapse,Value,RangeValue,SetFocus,ScrollItem.verificationobjectRequiredverification.evidencestringRequiredverification.statusstringRequiredOne of
verified,unverified,failed.
Fields nested deeper are in the schema.