Skip to main content
Glama

cua_mouse

Controls the mouse in any macOS or Windows app through virtual input, enabling clicks, drags, and scrolling without moving the user's cursor or stealing focus.

Instructions

Zero-conflict Virtual Mouse v2.2 for ANY macOS or Windows software. Defaults to input_mode='virtual' (macOS CGEvent postToPid / Windows PostMessage to background HWND), so the user's physical mouse cursor and foreground focus are NEVER hijacked! Supports logical/normalized[0..1000]/image coords or element ref IDs, left/right/middle buttons, modifier-held smooth drags, triple-click, scroll, and saved_restore/physical fallbacks.

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": {
      "action": "<action>"
    },
    "name": "cua_mouse"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNo
yNo
dxNo
dyNo
pidNoOptional target process ID for virtual mouse routing.
refNoClick/target numbered element [ref] from latest OCR/SoM/UI tree snapshot.
hwndNoOptional Windows HWND handle for virtual mouse routing.
to_xNo
to_yNo
stepsNo
actionYes
buttonNo
to_refNo
app_nameNoOptional target app name for virtual mouse routing (auto-reuses last screenshot/UI-tree target app if omitted).
modifiersNo
input_modeNo'virtual' (default, zero conflict with user's mouse/focus), 'saved_restore' (waits for user idle & restores cursor), or 'physical' (explicit foreground takeover).virtual
coord_spaceNological
duration_msNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.2.0

TDQS

A3.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that virtual mode posts events to a PID/HWND so the user's cursor and focus are not hijacked, and it describes the tradeoffs of the saved_restore and physical fallbacks. It omits prerequisites such as accessibility/screen-recording permissions and says nothing about what the 'position' action returns.

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?

The single paragraph is front-loaded with the differentiating trait (zero-conflict virtual routing) and then enumerates capabilities efficiently. It is slightly padded with marketing phrasing such as the version number, 'ANY', and the exclamation point, but no sentence is purely redundant.

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

Completeness3/5

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

For an 18-parameter mutating input tool with no annotations and no output schema, the description covers modes and coordinate systems but leaves permission requirements, timing parameters, and the meaning of the drag/scroll delta arguments unexplained. It is adequate to call the tool correctly in the common case but not complete for its complexity.

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

Parameters3/5

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

Schema coverage is only 28% across 18 parameters, and the description compensates for some of that: it explains input_mode, coord_space (logical/normalized 0..1000/image), button choices, modifiers, element ref IDs, and app_name reuse. It adds nothing about dx/dy defaults, steps, duration_ms, to_x/to_y/to_ref, or how pid and hwnd interact with app_name, leaving several high-impact parameters undocumented in both schema and description.

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?

The description states a concrete verb set and resource: it moves, clicks, drags and scrolls the mouse in any macOS or Windows app via a virtual input channel. It is clearly distinguishable from cua_keyboard by resource, but it never names or contrasts with cua_element_action or cua_app_control, which also target UI elements.

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

Usage Guidelines3/5

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

It gives useful mode-selection guidance: virtual is the default, saved_restore waits for user idle, physical takes the foreground, and ref IDs can target elements from the latest OCR/SoM/UI-tree snapshot. It does not say when to prefer this tool over element-based siblings such as cua_element_action or cua_find_elements, so the when-not decision is left to inference.

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