Skip to main content
Glama

click_element

Invoke UI elements by name or automationId using UIA InvokePattern, with automatic window verification. No screen coordinates needed.

Instructions

Invoke a UI element by name or automationId via UIA InvokePattern — no screen coordinates needed. The server auto-guards using windowTitle (verifies identity, foreground, modal) and returns post.perception.status. Prefer over mouse_click for buttons, menu items, and links in native Windows apps. Use desktop_discover first to discover automationIds. Pass fixId from a suggestedFix to re-target after window identity drift. lensId is optional for advanced pinned-lens use. Caveats: Typed errors: code:'InvokePatternNotSupported' — the control does not expose InvokePattern, fall back to mouse_click; code:'ElementDisabled' — the element is in a disabled state, re-check preconditions before retry; code:'GuardFailed' — read the perception envelope (attention / guard fields) and choose recovery (re-focus, wait, or pass the suggestedFix.fixId on the next call). Some custom controls do not expose InvokePattern at all; fall back to mouse_click for those.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
windowTitleYesPartial window title of the target window. Use '@active' for the current foreground window.
hwndNoDirect window handle ID (takes precedence over windowTitle). String to avoid 64-bit precision issues.
nameNoElement name/label (partial match, case-insensitive)
automationIdNoExact AutomationId of the element
controlTypeNoControl type filter, e.g. 'Button', 'MenuItem'
narrateNoNarration level. rich includes UIA or browser state diff when supported.minimal
lensIdNoOptional perception lens ID. Guards (safe.keyboardTarget, target.identityStable) are evaluated before clicking, and a perception envelope is attached to post.perception on success.
fixIdNoApprove a pending suggestedFix (one-shot, 15s TTL).
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).
Behavior5/5

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

No annotations exist, so description fully carries behavioral disclosure. It details auto-guarding with windowTitle, returns post.perception.status, lists typed errors (InvokePatternNotSupported, ElementDisabled, GuardFailed) with recovery suggestions, and mentions one-shot fixId with 15s TTL.

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?

Well-structured: starts with core functionality, then usage guidance, parameter details, and caveats. While lengthy, every sentence adds necessary information for correct tool selection and invocation. Could be slightly more concise, but the detail is justified given tool complexity.

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?

With 9 parameters, 1 required, and no output schema, the description is comprehensive. It covers error handling, fallback strategies, parameter semantics, and pre-requisites. The agent has enough context to use the tool effectively in various scenarios.

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 coverage is 100%, baseline 3. Description adds significant value: explains fixId for identity drift re-targeting, lensId for advanced pinned-lens use, controlType as filter, and include for response-shape opt-in. This clarifies nuanced parameter usage beyond basic schema descriptions.

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?

The description explicitly states the tool invokes a UI element via UIA InvokePattern by name or automationId. It distinguishes from sibling tool 'mouse_click' by specifying preference for buttons, menu items, and links in native Windows apps.

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?

Clear when-to-use guidance: prefer over mouse_click for native UI elements. Explicitly recommends using 'desktop_discover' first. Provides fallback scenarios: use mouse_click when InvokePatternNotSupported or for custom controls.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Harusame64/desktop-touch-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server