Skip to main content
Glama

java_click

Destructive

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

NameRequiredDescriptionDefault
clickNoleft
handleYes
simulateNo
session_idYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Adds substantial behavior beyond the annotations: the element is re-validated (role, name, sibling position, bounds) and aborts with a report rather than clicking if anything moved, and session-type limitations are spelled out. It never restates or conflicts with destructiveHint/openWorldHint, but stays silent on the side effects of a mis-targeted click beyond the guard message.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action and the default-vs-simulate decision before the Args section. Prose is dense and mostly earns its place, but the Returns block partly duplicates what the existing output schema already conveys.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutating tool with no annotation detail on validation or session constraints, the description supplies the guard semantics, failure modes, and error cases (is_error for unknown handle, changed element, bad click value). Nothing critical for invoking it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, yet every parameter is explained: session_id (provenance from java_attach_window), handle, simulate, and click with its three allowed values ('left', 'double', 'right') which the schema does not enumerate. This fills the gap the schema leaves entirely.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb plus resource ('Click an element') and enumerates concrete element kinds (button, menu item, check box, link, tree node). It clearly distinguishes itself from siblings by describing the interaction mode (accessibility action vs. simulated mouse), though it never names an alternative tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit when-to-use branch: default accessibility action, and 'Use `simulate=True` when the accessibility action is ignored'. It also states the preconditions for the simulated path (window must come to front, cannot work from a service session, needs real geometry). No explicit exclusions against siblings like java_select or java_send_keys.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.