Skip to main content
Glama

click_element

Click UI elements in Windows applications using accessibility identifiers instead of screen coordinates. Works with buttons, menu items, and links by name or automationId, with optional safety checks before execution.

Instructions

Invoke a UI element by name or automationId via UIA InvokePattern — no screen coordinates needed. Prefer over mouse_click for buttons, menu items, and links in native Windows apps. Use get_ui_elements first to discover automationIds. Pass lensId (from perception_register) to run safety guards (identity stable, foreground, modal) before invoking and receive post.perception state feedback without a screenshot. Caveats: Requires the element to expose InvokePattern — some read-only or custom controls do not; fall back to mouse_click in that case.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
windowTitleYesPartial window title of the target window
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.
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: it runs safety guards (identity stable, foreground, modal) when lensId is provided, requires the element to expose InvokePattern (with caveats for read-only or custom controls), and provides post.perception state feedback. However, it doesn't mention error handling or performance aspects like timeouts, leaving some gaps.

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

Conciseness5/5

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

The description is front-loaded with the core purpose, followed by usage guidelines, prerequisites, and caveats. Each sentence adds value without redundancy. It efficiently covers key points like when to use, how to prepare, safety features, and limitations in a compact format.

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

Completeness4/5

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

Given the tool's complexity (UI interaction with safety features), no annotations, and no output schema, the description does well by covering purpose, usage, prerequisites, behavioral traits, and caveats. However, it lacks details on return values or error responses, which would be helpful since there's no output schema. It's mostly complete but has minor gaps.

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 description coverage is 100%, so the baseline is 3. The description adds meaningful context beyond the schema: it explains that lensId enables safety guards and perception feedback, clarifies that name uses partial matching, and implies automationId is exact. It also hints at the purpose of controlType by listing examples like 'Button', 'MenuItem'. This elevates the score above the baseline.

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 clearly states the tool's purpose: 'Invoke a UI element by name or automationId via UIA InvokePattern — no screen coordinates needed.' It specifies the action (invoke), target (UI element), and mechanism (UIA InvokePattern), and distinguishes it from sibling tools like mouse_click and browser_click_element by emphasizing it's for native Windows apps and doesn't require screen coordinates.

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?

The description provides explicit guidance on when to use this tool vs. alternatives: 'Prefer over mouse_click for buttons, menu items, and links in native Windows apps' and 'fall back to mouse_click' if the element lacks InvokePattern. It also advises to 'Use get_ui_elements first to discover automationIds,' offering a clear workflow and prerequisites.

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