Request an invite
Docs menu

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

actionstringRequired

What to do.

One of invoke, toggle, expand, collapse, select, set_value, focus, scroll_into_view.

coordinate_spacestring

display: 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.

refstringRequired

A ref from screen_elements, such as kqzxw41.

screenshot_widthinteger

The width of the screenshot the coordinates are in.

From 1 to 8192.

timeout_secondsinteger

Seconds the guest may take; default 5.

From 1 to 20.

valuestring

For set_value: the text, or the number.

vmstringRequired

The 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

answeredbooleanRequired
coordinateSpacestringRequired

One of display, screenshot, normalized_1000.

effectstringRequired

One of changed, unchanged, gone, unknown.

elementobject
element.guestDataarray of objectsRequired
patternstringRequired

One of Invoke, Toggle, SelectionItem, ExpandCollapse, Value, RangeValue, SetFocus, ScrollItem.

verificationobjectRequired
verification.evidencestringRequired
verification.statusstringRequired

One of verified, unverified, failed.

Fields nested deeper are in the schema.

Report a problem with this page