Skip to main content
Glama

detect_elements

Enumerate interactive elements in a window via the platform accessibility tree, returning AI-friendly JSON with bounding boxes and centers for GUI automation.

Instructions

Enumerate interactive elements in a window via the platform accessibility tree. Returns AI-friendly JSON with bbox/center.

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>"
    },
    "name": "detect_elements"
  }
}

Input Schema

NameRequiredDescriptionDefault
hwndYes
depthNo
regexNo
restoreNocall ShowWindow(SW_RESTORE) first (UWP)
max_resultsNo
control_typeNo
name_containsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.1/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It usefully discloses the mechanism and return format, but says nothing about cost/latency (depth 30 and max_results 200 recursion could be slow), whether results are truncated when hitting max_results, or that the restore flag alters window state via ShowWindow.

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?

Two tight, front-loaded sentences with zero filler. It is efficient, though arguably too compressed for a seven-parameter tool with almost no schema documentation.

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

Completeness2/5

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

For a seven-parameter tool with no annotations, no output schema, and near-zero schema coverage, the definition is thin. It does sketch the return payload, but omits filtering behavior, result truncation, and the accessibility-tree caveat (elements absent from the tree will not be found).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 14% — just one of seven parameters (restore) is documented, and that comes from the schema, not the description. The description adds no meaning for hwnd, depth, regex, max_results, control_type, or name_contains, leaving an agent to guess filter matching semantics and recursion limits.

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 (enumerate) and resource (interactive elements in a window) plus the mechanism (platform accessibility tree), and adds the return shape (JSON with bbox/center). It does not name the sibling it is not, e.g. vision_detect or resolve_elements, so differentiation is left to inference.

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?

Implied usage only: an agent can infer this is the structural/accessibility-tree alternative to vision-based detection. There is no explicit when-to-use, when-not-to-use, or prerequisite statement (e.g. window must be visible, target must expose an a11y tree).

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