Skip to main content
Glama

wpf_wait_for_element

Waits until a WPF UI element matches a condition (visible, exists, enabled, hidden) by polling inside the target app, replacing sleep-and-retry. Use after clicks that trigger async work like dialogs or spinners.

Instructions

Wait until an element matching the criteria satisfies a condition, polling in the target app so you don't have to sleep-and-retry. Identify the element with automation_id (exact, case-sensitive), type_name, element_name and/or text (same matching as wpf_find_elements). condition: 'visible' (default — element exists and is on screen), 'exists' (in the tree even if not visible), 'enabled' (visible and IsEnabled=true), 'hidden' (no matching visible element — e.g. a spinner disappeared). Returns matched (bool), waited_ms, and matched_handle/element_type when found. Use after a click that triggers async work (dialog opens, spinner clears, button enables) before the next step. timeout_ms default 10000 (max 25000); poll_interval_ms default 250.

Input Schema

NameRequiredDescriptionDefault
textNo
conditionNovisible
type_nameNo
timeout_msNo
root_handleNo
element_nameNo
automation_idNo
poll_interval_msNo

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

A4.6/5.0
Behavior5/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 and does so well: it discloses polling mechanics, the default and max timeout (10000/25000), poll interval (250ms), what each condition means, and even the return shape (matched, waited_ms, matched_handle/element_type). It also explains the non-obvious 'hidden' condition (no matching visible element, e.g. a spinner disappeared), which is exactly the kind of semantic an agent could not infer.

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 dense with content; the condition list, return values, usage scenario, and timing defaults each earn their place. It is a single long block with no formatting breaks, which slightly hurts scanability for a definition this dense.

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

Completeness5/5

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

Given no annotations, no output schema, and 8 parameters with zero schema descriptions, the description supplies everything an agent needs: element matching semantics, condition definitions, timing bounds, and return values. Only root_handle is unaddressed, which is a minor gap against otherwise complete coverage.

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 description coverage is 0%, so the description must compensate, and it does for 7 of 8 parameters — including the critical condition enum values, which are absent from the schema, plus automation_id case-sensitivity and timing defaults/ranges. root_handle is never mentioned anywhere, leaving one parameter fully undefined.

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+resource ('Wait until an element matching the criteria satisfies a condition') and immediately distinguishes itself from the sibling finder by noting it uses 'the same matching as wpf_find_elements'. An agent can tell this is a polling wait, not a one-shot lookup, without opening the 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?

Gives a concrete trigger scenario ('Use after a click that triggers async work (dialog opens, spinner clears, button enables) before the next step') and frames the tool against the sleep-and-retry antipattern, which effectively routes the agent away from alternatives. It stops short of an explicit when-not (e.g., 'if the element is already present, use wpf_find_elements'), so it lands at 4 rather than 5.

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