Skip to main content
Glama

desktop_elements

Enumerate UI controls in a window via UI Automation to reliably locate specific elements like buttons by name, type, or AutomationId rather than guessing coordinates.

Instructions

元素级结构通道:枚举一个窗口内的 UI 控件(UI Automation)。 返回控件名称、类型(Button/Edit/...)、AutomationId、坐标矩形、是否可 Invoke。 适合定位"确定按钮"这类具体控件,比只按坐标猜可靠得多。 注意:Electron / Chromium 类应用默认不暴露控件树,会返回很少或 0 个 (这类需要用 CDP,即路线图 Week 5-6)。原生 Windows 应用正常。

Input Schema

NameRequiredDescriptionDefault
handleYes窗口句柄,来自 desktop_list_windows / desktop_perceive
maxElementsNo最多返回多少个,默认 300

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.2

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the burden and mostly does: it discloses the return shape, the handle dependency on desktop_list_windows/desktop_perceive, and the important behavioral caveat that Electron/Chromium apps return few or zero elements. It does not mention cost, latency, or that UI Automation queries can hang on unresponsive windows — minor omissions for an unannotated read tool.

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 the operation, then return fields, then intended use, then the caveat — a clean progression with no filler. The persuasive line about being more reliable than coordinate guessing is slightly redundant with the usage sentence, keeping it just under perfect.

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 two-parameter tool with no annotations and no output schema, the description compensates by enumerating the return fields and flagging the main failure mode. It lacks only robustness details (empty-result handling, latency on hung windows) that an agent would want before calling it blind.

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 100%, so both parameters (handle and maxElements with default 300) are already documented in the schema. The description only implies that a window scope is required ("a window") and adds no format or default detail beyond the schema, so baseline 3 applies.

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 (enumerate UI controls in a window via UI Automation) and immediately names the sibling it must not be confused with (CDP-based element access for Electron/Chromium). The listed return fields (name, type, AutomationId, rect, Invoke-ability) pin down what kind of data comes back, letting an agent distinguish it from desktop_perceive / desktop_screenshot without opening schemas.

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?

Explicitly says when to use it (locating a concrete control like an "OK button" rather than guessing coordinates) and when not to (Electron/Chromium apps that expose no control tree — use CDP instead). The alternative route is named and the failure condition is quantified ("very few or 0 elements").

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