Skip to main content
Glama

wpf_find_elements

Find UI elements across open WPF windows by visible text, control type, AutomationId, name, or property filters; results include text, visibility, enabled state, and screen bounds.

Instructions

Query elements across all open windows. Filters combine with AND: automation_id (exact, case-sensitive AutomationProperties.AutomationId), type_name (partial match, e.g. 'Button' matches 'System.Windows.Controls.Button'), element_name (x:Name substring), text (visible text content — matches a Button's caption, TextBlock text, Window title, AutomationProperties.Name, ToolTip; case-insensitive substring), property_filter (object of property name → expected value substring, e.g. {"IsEnabled": "True"}), visible_only (exclude collapsed/hidden elements — recommended when looking for something the user can see). PREFER text over dumping the tree: e.g. text='Save' + type_name='Button' finds the Save button directly. Results include text, automationId, isVisible, isEnabled and screenBounds (device pixels) so you can pick the right element without extra calls. Returns up to max_results (default 50).

Input Schema

NameRequiredDescriptionDefault
textNo
type_nameNo
max_resultsNo
root_handleNo
element_nameNo
visible_onlyNo
automation_idNo
property_filterNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.17.2
    • addedInput schema / properties / automation_id
      Added value: +{
      +  "default": null,
      +  "type": "string"
      +}
  2. First observedv0.1.0

TDQS

A3.8/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 disclose useful behavior: filters combine with AND, exact vs partial vs case-insensitive matching, the returned fields (text, automationId, isVisible, isEnabled, screenBounds), and the max_results default. However it never states that an attach/session is required, nor whether the call is read-only or what happens when nothing matches — meaningful gaps for an 8-param query tool with zero annotation coverage.

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 core purpose in sentence one, followed by per-filter definitions and a usage recommendation; nearly every clause adds information. It is dense — a single long parenthetical sentence for 'text' — but not padded.

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?

No output schema exists, and the description usefully enumerates return fields and the result cap so the agent can act on results. Missing root_handle semantics and the session/attach prerequisite keep it from being fully complete.

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 largely does: it defines text, type_name, element_name, automation_id, property_filter (with a JSON example) and visible_only precisely, plus max_results. Only root_handle is left entirely undefined, which is why this falls short of 5.

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?

Opens with a specific verb+resource ('Query elements across all open windows') and enumerates the filter dimensions, so an agent knows exactly what it does. It never differentiates itself from the sibling wpf_find_elements_deep, leaving ambiguity about which finder to call.

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 actionable guidance: 'PREFER text over dumping the tree' with a worked example (text='Save' + type_name='Button'), and recommends visible_only 'when looking for something the user can see'. It omits when to prefer wpf_get_visual_tree or wpf_find_elements_deep, so exclusion guidance is incomplete.

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