java_click
Clicks buttons, menu items, check boxes, links or tree nodes in Java Swing/AWT apps using accessibility actions or simulated mouse input, verifying the element first to prevent misclicks.
Instructions
Click an element: a button, a menu item, a check box, a link, a tree node.
By default this uses the element's accessibility action, which is what the
application itself exposes: no mouse moves, no window comes to the front, and it works
where there is no interactive desktop. Use simulate=True when the accessibility
action is ignored — it drives real mouse input, which requires the window to come to
the front and cannot work from a service session, and it needs real geometry (cells in
some tables report bounds = -1, and there is no point to click).
The element is checked before it is clicked: role, name, position among siblings and bounds are compared against what the snapshot recorded, and if anything differs nothing is clicked — the difference is reported instead. That is deliberate: a click that lands on whatever moved into the position is worse than a message.
Args: session_id: From java_attach_window. handle: The element to click. click: "left", "double" or "right". simulate: Drive real mouse input instead of the accessibility action.
Returns: What was clicked and how, so the next call knows what state the window is in.
Errors:
is_error for an unknown handle, for an element that changed since the
snapshot, and for a click value that is not one of the three.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"session_id": "<session_id>",
"handle": "<handle>"
},
"name": "java_click"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| click | No | left | |
| handle | Yes | ||
| simulate | No | ||
| session_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |