Skip to main content
Glama

wpf_assert

Assert a WPF element's dependency-property value with an exact invariant-string comparison (use {null} for null) and fail on mismatch; target by element handle or exact automation ID.

Instructions

Assert an element's dependency-property value using an exact ordinal comparison of its invariant string value; use {null} for null. Throws on mismatch. Successful assertions are saved while recording. Use wpf_wait_for_element first for asynchronous changes. Target by exactly one of element_handle or automation_id (exact, case-sensitive AutomationProperties.AutomationId). Use root_handle with automation_id to scope lookup; missing or duplicate IDs fail before input.

Input Schema

NameRequiredDescriptionDefault
root_handleNo
automation_idNo
property_nameYes
element_handleNo
expected_valueYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.17.2
    • addedInput schema / properties / automation_id
      Added value: +{
      +  "default": null,
      +  "type": "string"
      +}
    • addedInput schema / properties / element_handle / default
      Added value: +null
    • addedInput schema / properties / root_handle
      Added value: +{
      +  "default": null,
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "element_handle",
      -  "property_name",
      -  "expected_value"
      -]New value: +[
      +  "property_name",
      +  "expected_value"
      +]
  2. Addedv0.12.1

TDQS

A4.6/5.0
Behavior4/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 well: it discloses that mismatch throws, that passing assertions are persisted while recording, and that ambiguous or absent IDs fail before any input is used. It stops short of describing what a successful call returns or whether other state changes occur.

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?

Dense and front-loaded with the core behavior first, then alternatives, then targeting rules. The semicolon-chained clauses make a few statements terse to the point of being cryptic (e.g. 'missing or duplicate IDs fail before input').

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 five-parameter assertion tool with no output schema and no annotations, the description covers targeting, comparison semantics, failure behavior, and recording side effects. The main gap is the return value/result shape on success, which nothing else supplies.

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

Parameters5/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: mutual exclusivity of element_handle vs automation_id, case-sensitive exact AutomationId matching, root_handle as a scoping modifier, and the '{null}' sentinel for expected_value. This adds substantial meaning beyond the bare schema types.

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: asserts an element's dependency-property value via exact ordinal comparison of the invariant string. It also distinguishes itself from siblings by naming wpf_wait_for_element as the tool for asynchronous changes, so an agent can separate it from discovery/wait tools.

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?

Gives explicit preconditions and alternatives: 'Use wpf_wait_for_element first for asynchronous changes', and 'Target by exactly one of element_handle or automation_id'. The root_handle scoping rule and the fail-fast behavior for missing/duplicate IDs further constrain correct invocation.

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