Skip to main content
Glama

click_by_id

Clicks a UI element by its stable automation_id, so targets with changing labels like countdowns or spinners still resolve reliably. Runs dry by default to verify the element before any real click.

Instructions

Click an element addressed by its stable automation_id. Use this instead of click-by-name when the visible label changes (a live countdown, a spinner): the automation id is the anchor that does not move. Prefers the UIA Invoke pattern, so it needs no pixel maths, does not move the user's cursor and does not steal focus. Default dry_run=true (resolves the target, clicks nothing).

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": {
      "hwnd": "<hwnd>",
      "automation_id": "<automation_id>"
    },
    "name": "click_by_id"
  }
}

Input Schema

NameRequiredDescriptionDefault
hwndYes
budgetNohow many times this call may drive the user's pointer (0 = never, the default)
methodNoauto tries Invoke first, then a window message, then a pixel click paid for from budgetauto
dry_runNo
control_typeNo
automation_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.2/5.0
Behavior3/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 on safety: it discloses the UIA Invoke preference, that no pixel maths/cursor movement/focus theft occurs, and that dry_run defaults to true and clicks nothing. It omits failure behavior (element not found, Invoke unsupported fallback cost) and what a call returns, leaving real gaps for an input-driving tool.

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?

Three dense sentences, front-loaded with the verb and target, then the differentiator, then the mechanism, then the safety default. No filler or restatement of the name.

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?

For a 6-parameter, no-annotation, no-output-schema UI automation tool, the definition covers the critical decisions: which addressing scheme, which underlying mechanism, and the safe default. Gaps are the undocumented hwnd/control_type parameters and the absence of error or return behavior.

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?

At 33% schema coverage the description must compensate, and it does for the important ones: automation_id is explained as the stable anchor versus a changing label, dry_run as resolve-only-by-default, and method's Invoke-first behavior and budget cost are implied. hwnd and control_type remain unexplained in both schema and description.

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?

"Click an element addressed by its stable automation_id" gives a specific verb plus the exact addressing resource, and the following clause names the alternative it replaces (click-by-name) and the condition that selects it. An agent can distinguish it from the generic click/browser_click siblings 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 Guidelines4/5

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

It states the selection condition precisely: use this instead of a name-based click when the visible label is unstable (countdown, spinner). That is clear when-to-use guidance, but there is no explicit when-not-to-use and the named alternative (click-by-name) is not obviously present among the siblings, so routing is slightly ambiguous.

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