Skip to main content
Glama

click_element

Clicks or invokes a Windows UI element by cached ID, name, or automation ID, using background UI Automation first and guarded SendInput fallback to avoid cursor or focus hijacks.

Instructions

Click/invoke a UI element by cached element_id (from inspect_ui), name, or automation_id.

Uses background UI Automation patterns first (zero cursor/focus hijack) with guarded SendInput fallback.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "click_element"
  }
}

Input Schema

NameRequiredDescriptionDefault
hwndNo
nameNo
element_idNo
control_typeNo
automation_idNo
restore_cursorNo
title_containsNo
fallback_to_sendinputNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.2

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does disclose the important trait: background UI Automation patterns are attempted first so the cursor and focus are not hijacked, with SendInput only as a guarded fallback. It stops short of saying what happens on failure or when multiple elements match, and gives no warning that a click may itself trigger a destructive action in the target app.

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?

Two sentences, both front-loaded with the most decision-relevant facts (selectors first, execution strategy second). No filler, no restatement of the tool name, and each clause adds information the agent cannot get from the empty schema.

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?

An output schema exists, so return values need not be described, and the core behavior is covered. What is missing for an 8-parameter automation tool with no annotations is selector precedence and the semantics of the remaining window/control-type filters, which leaves meaningful ambiguity for an agent constructing a call.

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 description coverage is 0% across 8 parameters, so the description must compensate and it only partially does: element_id, name and automation_id are explained, and 'zero cursor/focus hijack' plus 'SendInput fallback' hint at restore_cursor and fallback_to_sendinput. hwnd, control_type and title_contains are left entirely undocumented, as is what happens when no selector is supplied.

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?

States a specific verb (click/invoke) and resource (UI element), plus the three lookup keys (cached element_id, name, automation_id) and the source of element_id (inspect_ui). It does not, however, distinguish itself from the sibling tool named 'click', leaving the agent to guess which click variant to pick.

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?

The parenthetical '(from inspect_ui)' implicitly establishes a workflow: inspect first, then click with the cached id. Beyond that it offers no when-to-use/when-not guidance, no statement of precedence among the three selectors, and no routing away from the sibling 'click' tool.

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