Skip to main content
Glama

mouse_click

Click at screen coordinates, optionally targeting a window so the server verifies the target, guards the click, and returns post-click perception.

Instructions

Click at screen coordinates. Normally pass windowTitle so the server auto-guards the click (verifies target identity, foreground, coordinate is inside the target rect) and returns post.perception without a confirmation screenshot. origin+scale from dotByDot=true screenshots are converted to screen coords before guarding. doubleClick:true for double-click; tripleClick:true for triple-click (selects a full line of text). Prefer click_element (UIA) for native apps, prefer browser_click for Chrome. Examples: mouse_click({windowTitle:'Notepad', x:200, y:150}) // guarded — post.perception.status='ok'. mouse_click({x:100, y:100}) // unguarded — post.perception.status='unguarded'. If a guard failure returns a suggestedFix, pass its fixId to approve the fix: mouse_click({fixId:'fix-...'}) // one-shot, expires in 15s. lensId is optional and only for advanced pinned-target workflows; omit it for normal use. Caveats: origin+scale are meaningful ONLY with dotByDot=true screenshot responses. hints.verifyDelivery:{status:'delivered'|'focus_only'|'unverifiable', reason} reports the post-click observation; the status is decided from three signals — focused-element shift, the element under the cursor changing between two readable reads, and window-foreground change — or from none of them firing. Win11 foreground refusal during the homing path (UIPI cross-elevation / admin-only target / call from a background process or service) returns code:'ForegroundRestricted' ok:false rather than landing the click on the wrong window — recover by switching to a tool that accepts windowTitle directly (click_element / desktop_act) — browser_* tools target by tabId/selector, not windowTitle. A window on another virtual desktop returns WindowOnOtherDesktop and nothing is sent — the user's desktop is not switched. MouseClickNotDelivered is reserved-only (false-positive risk is too high to emit a typed code), so degradation is expressed via the 'unverifiable' status, not a separate error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX coordinate. Screen-absolute by default. When 'origin' is provided, treated as image-local (pixel position within the screenshot).
yYesY coordinate. Screen-absolute by default. When 'origin' is provided, treated as image-local.
hwndNoDirect window handle ID (takes precedence over windowTitle). Obtain from desktop_discover response (windows[].hwnd). String type to avoid 64-bit precision issues.
fixIdNoOne-shot fix approval ID. If a previous mouse_click returned a suggestedFix, pass that fixId here to approve it. The server revalidates the fix and executes with corrected args. fixId expires in 15 seconds and can only be used once.
scaleNoScale factor from screenshot response (only when dotByDotMaxDimension caused a resize). Omit if the screenshot was 1:1. Only used when 'origin' is also provided.
speedNoCursor movement speed in px/sec. 0 = instant (teleport, no animation). Omit to use the configured default (DESKTOP_TOUCH_MOUSE_SPEED env var, default 3000).
buttonNoMouse button to clickleft
homingNoEnable homing correction (default true). When enabled, the MCP server corrects stale coordinates if the target window moved since the last screenshot. Set false to disable all correction (like traction control OFF).
lensIdNoOptional perception lens ID for advanced pinned-target workflows. When provided, guards are evaluated before clicking (safe.clickCoordinates, target.identityStable) and a perception envelope is attached to post.perception in the response. For normal use, omit lensId and pass windowTitle directly — Auto Perception handles tracking.
originNoWhen set, (x,y) are image-local coords from a screenshot. Server converts to screen coords: screen_x = origin.x + x / (scale ?? 1), screen_y = origin.y + y / (scale ?? 1). Copy origin values directly from the screenshot response text. This eliminates manual coord math and prevents out-of-window clicks.
includeNoOptional response-shape opt-in. `['envelope']` returns the self-documenting envelope (`_version` / `data` / `as_of` / `confidence`). `['raw']` forces raw shape (overrides DESKTOP_TOUCH_ENVELOPE=1 server default). Default behaviour is raw shape (compat with existing clients).
narrateNoNarration level. "rich": include UIA diff in post.rich (appeared/disappeared/valueDeltas, and nameDeltas when an element's name changed, such as a calculator display) — usually removes the need for a verification screenshot. It is withheld, with post.rich.diffDegraded saying why, when the diff cannot be shown to describe the window that was acted on. On click_element and keyboard (and set_element_value where the server registers it), which resolve the target window before acting: another open window's title contains the text this call resolved to, whether you named the hwnd or the server did — "@active" and the dialog rescue both resolve one ("ambiguous_title"); or the target moved between the snapshot and the action ("target_changed"). On those and on mouse_click, retrying with a fixId also withholds it, because the stored fix names a window this cannot see ("fix_target_unknown") — browser tools keep their diff on a fixId retry, because theirs is a tab diff and does not depend on a window title. mouse_click and mouse_drag accept an hwnd and still take their snapshots by windowTitle, so nothing else is withheld for them: verify those with a screenshot. A window too large to read whole is withheld too ("tree_truncated"). The action itself is unaffected in every case; only the diff is. Default: "minimal".minimal
settleMsNoMilliseconds to wait after the action before checking foreground window (default 300). Only used when trackFocus=true.
elementIdNoHint: automationId of the UI element (from actionable[].id). Requires windowTitle. Used with elementName for more precise UIA re-query.
forceFocusNoWhen true, bypass Windows foreground-stealing protection via AttachThreadInput before focusing the target window. Required when a pinned window (e.g. Claude CLI) keeps stealing focus. Default: follows env DESKTOP_TOUCH_FORCE_FOCUS (default false). Set DESKTOP_TOUCH_FORCE_FOCUS=1 to make true the global default.
trackFocusNoWhen true (default), detect if focus was stolen from the target window after the action. Reports focusLost:{afterMs,expected,stolenBy,stolenByProcessName} in the response. Set false to skip the settle wait and focus check.
doubleClickNoWhether to double-click
elementNameNoHint: name/label of the UI element (from actionable[].name in screenshot(detail='text')). Requires windowTitle. Triggers UIA re-query to get fresh coordinates when the window resized or moved far.
tripleClickNoWhether to triple-click (select a line of text). Takes precedence over doubleClick when both are true.
windowTitleNoHint: partial title of the window being clicked. Enables window-delta correction and auto-focus if the window went behind another. Use '@active' for the current foreground window. Example: "メモ帳", "Google Chrome"
verifyDeliveryNoWhen true (default), capture pre/post snapshots of element-under-cursor + focusedElement + foregroundWindow + scrollPos to populate hints.verifyDelivery with status='delivered' | 'focus_only' | 'unverifiable' (issue #178). Set false to skip the extra UIA work when the caller will read post state itself.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed19 schema fields changedv2.3.1
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / elementId / description
      Previous value: -"AutomationId of the UI element."New value: +"Hint: automationId of the UI element (from actionable[].id). Requires windowTitle. Used with elementName for more precise UIA re-query."
    • changedInput schema / properties / elementName / description
      Previous value: -"Name or label of the UI element."New value: +"Hint: name/label of the UI element (from actionable[].name in screenshot(detail='text')). Requires windowTitle. Triggers UIA re-query to get fresh coordinates when the window resized or moved far."
    • changedInput schema / properties / forceFocus / description
      Previous value: -"Bypass Windows foreground-stealing protection before focusing."New value: +"When true, bypass Windows foreground-stealing protection via AttachThreadInput before focusing the target window. Required when a pinned window (e.g. Claude CLI) keeps stealing focus. Default: follows env DESKTOP_TOUCH_FORCE_FOCUS (default false). Set DESKTOP_TOUCH_FORCE_FOCUS=1 to make true the global default."
    • changedInput schema / properties / homing / description
      Previous value: -"Enable homing correction if the target window moved."New value: +"Enable homing correction (default true). When enabled, the MCP server corrects stale coordinates if the target window moved since the last screenshot. Set false to disable all correction (like traction control OFF)."
    • changedInput schema / properties / hwnd / description
      Previous value: -"Direct window handle ID (takes precedence over windowTitle). Obtain from get_windows response (hwnd field). String type to avoid 64-bit precision issues."New value: +"Direct window handle ID (takes precedence over windowTitle). Obtain from desktop_discover response (windows[].hwnd). String type to avoid 64-bit precision issues."
    • changedInput schema / properties / narrate / description
      Previous value: -"Narration level. rich includes UIA or browser state diff when supported, and is withheld with post.rich.diffDegraded when the diff cannot be shown to describe the window that was acted on."New value: +"Narration level. \"rich\": include UIA diff in post.rich (appeared/disappeared/valueDeltas, and nameDeltas when an element's name changed, such as a calculator display) — usually removes the need for a verification screenshot. It is withheld, with post.rich.diffDegraded saying why, when the diff cannot be shown to describe the window that was acted on. On click_element and keyboard (and set_element_value where the server registers it), which resolve the target window before acting: another open window's title contains the text this call resolved to, whether you named the hwnd or the server did — \"@active\" and the dialog rescue both resolve one (\"ambiguous_title\"); or the target moved between the snapshot and the action (\"target_changed\"). On those and on mouse_click, retrying with a fixId also withholds it, because the stored fix names a window this cannot see (\"fix_target_unknown\") — browser tools keep their diff on a fixId retry, because theirs is a tab diff and does not depend on a window title. mouse_click and mouse_drag accept an hwnd and still take their snapshots by windowTitle, so nothing else is withheld for them: verify those with a screenshot. A window too large to read whole is withheld too (\"tree_truncated\"). The action itself is unaffected in every case; only the diff is. Default: \"minimal\"."
    • removedInput schema / properties / origin / additionalProperties
      Removed value: -false
    • addedInput schema / properties / scale / exclusiveMinimum
      Added value: +0
    • changedInput schema / properties / settleMs / description
      Previous value: -"Milliseconds to wait before checking post-action state."New value: +"Milliseconds to wait after the action before checking foreground window (default 300). Only used when trackFocus=true."
    • changedInput schema / properties / speed / description
      Previous value: -"Cursor movement speed in px/sec. 0 = instant."New value: +"Cursor movement speed in px/sec. 0 = instant (teleport, no animation). Omit to use the configured default (DESKTOP_TOUCH_MOUSE_SPEED env var, default 3000)."
    • addedInput schema / properties / speed / maximum
      Added value: +9007199254740991
    • changedInput schema / properties / trackFocus / description
      Previous value: -"Detect if focus was stolen after the action."New value: +"When true (default), detect if focus was stolen from the target window after the action. Reports focusLost:{afterMs,expected,stolenBy,stolenByProcessName} in the response. Set false to skip the settle wait and focus check."
    • addedInput schema / properties / verifyDelivery / default
      Added value: +true
    • changedInput schema / properties / verifyDelivery / description
      Previous value: -"Parameter 'verifyDeliveryParam' from the Windows server schema."New value: +"When true (default), capture pre/post snapshots of element-under-cursor + focusedElement + foregroundWindow + scrollPos to populate hints.verifyDelivery with status='delivered' | 'focus_only' | 'unverifiable' (issue #178). Set false to skip the extra UIA work when the caller will read post state itself."
    • addedInput schema / properties / verifyDelivery / type
      Added value: +"boolean"
    • changedInput schema / properties / windowTitle / description
      Previous value: -"Partial title of the target window."New value: +"Hint: partial title of the window being clicked. Enables window-delta correction and auto-focus if the window went behind another. Use '@active' for the current foreground window. Example: \"メモ帳\", \"Google Chrome\""
    • changedInput schema / required
      Previous value: -[
      -  "x",
      -  "y",
      -  "verifyDelivery"
      -]New value: +[
      +  "x",
      +  "y"
      +]
  2. Changed1 schema field changedv2.0.0
    • changedInput schema / properties / narrate / description
      Previous value: -"Narration level. rich includes UIA or browser state diff when supported."New value: +"Narration level. rich includes UIA or browser state diff when supported, and is withheld with post.rich.diffDegraded when the diff cannot be shown to describe the window that was acted on."
  3. Addedv1.12.0
  4. Removedv1.10.4
  5. Addedv1.9.2
  6. Removedv1.8.0
  7. Addedv1.6.0
  8. Removedv1.5.1
  9. Addedv1.5.0
  10. Removedv1.4.3
  11. Addedv1.4.2
  12. Removedv1.4.0
  13. Changed1 schema field changedv1.2.1
    • addedInput schema / properties / include
      Added value: +{
      +  "description": "Optional response-shape opt-in. `['envelope']` returns the self-documenting envelope (`_version` / `data` / `as_of` / `confidence`). `['raw']` forces raw shape (overrides DESKTOP_TOUCH_ENVELOPE=1 server default). Default behaviour is raw shape (compat with existing clients).",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  14. Changed3 schema fields changedv1.1.1
    • addedInput schema / properties / origin / additionalProperties
      Added value: +false
    • addedInput schema / properties / origin / properties
      Added value: +{
      +  "x": {
      +    "description": "Screen x of image top-left (copy from screenshot response)",
      +    "type": "number"
      +  },
      +  "y": {
      +    "description": "Screen y of image top-left (copy from screenshot response)",
      +    "type": "number"
      +  }
      +}
    • addedInput schema / properties / origin / required
      Added value: +[
      +  "x",
      +  "y"
      +]
  15. Addedv1.0.3
  16. Removedv0.15.7
  17. Changed1 schema field changedv0.15.4
    • addedInput schema / properties / hwnd
      Added value: +{
      +  "description": "Direct window handle ID (takes precedence over windowTitle). Obtain from get_windows response (hwnd field). String type to avoid 64-bit precision issues.",
      +  "type": "string"
      +}
  18. Changed1 schema field changedv0.13.1
    • addedInput schema / properties / fixId
      Added value: +{
      +  "description": "One-shot fix approval ID. If a previous mouse_click returned a suggestedFix, pass that fixId here to approve it. The server revalidates the fix and executes with corrected args. fixId expires in 15 seconds and can only be used once.",
      +  "type": "string"
      +}
  19. Changed21 schema fields changedv0.10.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / _stub
      Removed value: -{
      -  "description": "Stub tool — arguments ignored."
      -}
    • addedInput schema / properties / button
      Added value: +{
      +  "default": "left",
      +  "description": "Mouse button to click",
      +  "enum": [
      +    "left",
      +    "right",
      +    "middle"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / doubleClick
      Added value: +{
      +  "default": false,
      +  "description": "Whether to double-click",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / elementId
      Added value: +{
      +  "description": "AutomationId of the UI element.",
      +  "type": "string"
      +}
    • addedInput schema / properties / elementName
      Added value: +{
      +  "description": "Name or label of the UI element.",
      +  "type": "string"
      +}
    • addedInput schema / properties / forceFocus
      Added value: +{
      +  "description": "Bypass Windows foreground-stealing protection before focusing.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / homing
      Added value: +{
      +  "default": true,
      +  "description": "Enable homing correction if the target window moved.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / lensId
      Added value: +{
      +  "description": "Optional perception lens ID from perception_register. When provided, guards are evaluated before clicking (safe.clickCoordinates, target.identityStable) and a perception envelope is attached to post.perception in the response.",
      +  "type": "string"
      +}
    • addedInput schema / properties / narrate
      Added value: +{
      +  "default": "minimal",
      +  "description": "Narration level. rich includes UIA or browser state diff when supported.",
      +  "enum": [
      +    "minimal",
      +    "rich"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / origin
      Added value: +{
      +  "description": "When set, (x,y) are image-local coords from a screenshot. Server converts to screen coords: screen_x = origin.x + x / (scale ?? 1), screen_y = origin.y + y / (scale ?? 1). Copy origin values directly from the screenshot response text. This eliminates manual coord math and prevents out-of-window clicks.",
      +  "type": "object"
      +}
    • addedInput schema / properties / scale
      Added value: +{
      +  "description": "Scale factor from screenshot response (only when dotByDotMaxDimension caused a resize). Omit if the screenshot was 1:1. Only used when 'origin' is also provided.",
      +  "type": "number"
      +}
    • addedInput schema / properties / settleMs
      Added value: +{
      +  "default": 300,
      +  "description": "Milliseconds to wait before checking post-action state.",
      +  "maximum": 2000,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / speed
      Added value: +{
      +  "description": "Cursor movement speed in px/sec. 0 = instant.",
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / trackFocus
      Added value: +{
      +  "default": true,
      +  "description": "Detect if focus was stolen after the action.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / tripleClick
      Added value: +{
      +  "default": false,
      +  "description": "Whether to triple-click (select a line of text). Takes precedence over doubleClick when both are true.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / windowTitle
      Added value: +{
      +  "description": "Partial title of the target window.",
      +  "type": "string"
      +}
    • addedInput schema / properties / x
      Added value: +{
      +  "description": "X coordinate. Screen-absolute by default. When 'origin' is provided, treated as image-local (pixel position within the screenshot).",
      +  "type": "number"
      +}
    • addedInput schema / properties / y
      Added value: +{
      +  "description": "Y coordinate. Screen-absolute by default. When 'origin' is provided, treated as image-local.",
      +  "type": "number"
      +}
    • addedInput schema / required
      Added value: +[
      +  "x",
      +  "y"
      +]
  20. First observedv0.6.2

TDQS

A4.8/5.0
Behavior5/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 so richly: auto-guarding semantics, post.perception.status values, hints.verifyDelivery status derivation from three signals, ForegroundRestricted recovery path, WindowOnOtherDesktop non-action, and the deliberate suppression of a MouseClickNotDelivered typed code. This is far more behavioral context than any structured field provides.

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 primary guidance, and nearly every sentence carries information (errors, recovery, verification). However it is a single dense block with many interleaved caveats, which taxes scanability for a click tool.

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 21-parameter, enum-heavy tool with nested objects and no output schema, the description covers error codes, recovery alternatives, verification signalling, and guard behavior. An agent has everything needed to call it correctly and interpret failures.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds cross-parameter meaning the schema states only in isolation: origin+scale are meaningful ONLY with dotByDot=true responses and are converted to screen coords before guarding, and fixId is a one-shot 15s approval token. It adds real semantics beyond per-parameter docs.

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

Purpose5/5

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

Opens with a specific verb+resource ("Click at screen coordinates") and immediately distinguishes itself from siblings by naming click_element (UIA native apps) and browser_click (Chrome) as preferred alternatives in their domains. An agent can place this tool vs. its neighbors without opening any schema.

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

Usage Guidelines5/5

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

Explicit when-to-use rules: normally pass windowTitle so the click is guarded, omit lensId for normal use, use doubleClick/tripleClick flags for multi-clicks. It even names the exclusions (prefer click_element for native apps, browser_click for Chrome) and gives concrete guarded vs. unguarded examples.

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