Skip to main content
Glama

find_elements

Find interactive desktop GUI elements by role and exact name, returning handles to pass to click or type actions. Narrows searches by role and name to avoid timeouts on large window trees.

Instructions

Find interactive elements by role and/or name. Returns element handles; pass the 'id' field to click/type_text/etc. Common roles: button, combo box, text, entry, check box, menu item. name is an exact match, not a substring ("Load Listfile…" with its ellipsis, "Export Folder" not "Export"); use get_tree to read names.

On a window with a huge tree a search gives up after about 10 s and returns {"error": "searched N elements ..."}; narrow it by role and name.

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": {
      "window_id": "<window_id>"
    },
    "name": "find_elements"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNo
roleNo
window_idYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.2.1
    • addedOutput schema / properties / result / anyOf
      Added value: +[
      +  {
      +    "items": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  }
      +]
    • removedOutput schema / properties / result / items
      Removed value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}
    • removedOutput schema / properties / result / type
      Removed value: -"array"
  2. First observedv0.1.0

TDQS

A4.5/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 well: it discloses the handle/id return contract, exact-match (not substring) matching with concrete examples including the ellipsis trap, and the ~10 s timeout on very large trees along with the shape of the error payload. That is the kind of failure-mode context an agent cannot get from the schema.

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 purpose and return behavior, then matching semantics, then the timeout caveat — a sensible order. The line-broken formatting is slightly cramped, and the role list and timeout note could be tightened, but no sentence is filler.

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?

Coverage is strong for a 3-parameter tool: purpose, return handles, matching rules, and failure behavior are all present, and an output schema means return values needn't be spelled out. Remaining gaps are small but real — the source of window_id, and whether role matching is case-sensitive or accepts partial names.

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 0%, so the description must compensate, and it largely does: name is defined as an exact match with illustrative values, and role is illustrated with common values (button, combo box, text, entry, check box, menu item). window_id is only obliquely referenced ("On a window with a huge tree") — it never says where to get a window id or how it is sourced.

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?

States a specific verb and resource ("Find interactive elements by role and/or name") and immediately explains the return contract ("Returns element handles; pass the 'id' field to click/type_text/etc."). It also distinguishes itself from get_tree by assigning name-reading to that sibling.

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?

Gives real routing guidance: use get_tree to read names when you don't know the exact string, and narrow the query by role and name when a search times out. It does not spell out positive use cases (e.g. "use this when you already know the exact label") or how the role/name filters combine, so it falls short of fully explicit when/when-not guidance.

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