Skip to main content
Glama

Find Unresolved XAML Bindings

find_unresolved_bindings
Read-onlyIdempotent

Detect silently broken XAML bindings whose root member is missing from a confidently resolved DataContext view-model; use after renaming or removing view-model members.

Instructions

List silently broken XAML bindings: a {Binding X} whose root member does NOT exist on its confidently resolved DataContext view-model (typo, removed/renamed member, or wrong DataContext) - neither the compiler nor a render smoke catches it.

Use it after renaming or removing view-model members. It judges a binding path's ROOT member only. Where a member or a resource key is bound: find_binding_usages / find_resource_usages.

Covers WPF/WinUI .xaml (view-model via d:DesignInstance or a unique FooView->FooViewModel convention) and Avalonia .axaml ({Binding}/{CompiledBinding}, only via x:DataType). Conservative BY SKIPPING: a binding whose DataContext scope cannot be typed with certainty (ControlTemplate, any Style but the element's own inline one, runtime DataContext, keyed resources, a DataType-less template unless - WPF only - its host's ItemsSource types it, code-behind setting DataContext = this), or whose view-model has an unverifiable external base, is never flagged. Source-generated ([ObservableProperty]/[RelayCommand]) and inherited members count as resolved. A hit is evidence to verify at its line, not proof.

Returns count and unresolvedBindings (view, viewModel, member, line; one entry per site), plus markupFilesScanned and bindingSitesInMarkup from a live disk walk. count's denominator: sitesJudged and sitesSkipped, by reason in sitesSkippedBy (both null on a recalled session); judgementNote names any gap to bindingSitesInMarkup. sitesSkippedByView: each view's skipped sites by reason, with lines (max 100 views).

WinUI {x:Bind} is apart: each path segment is looked up on the page's x:Class or the template's x:DataType; one absent on a non-partial type is listed with form 'xBind' (viewModel = the type looked in). xBindSitesInMarkup/Judged/Skipped/SkippedBy: only where x:Bind sites exist.

Read-only; LIVE analysis only: refresh_session after edits (a recalled snapshot reports none; a 'note' says so).

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": {
      "sessionId": "<sessionId>"
    },
    "name": "find_unresolved_bindings"
  }
}

Input Schema

NameRequiredDescriptionDefault
sessionIdYesThe session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.46513
    • changedInput schema / properties / sessionId / description
      Previous value: -"The session_id returned by analyze_solution."New value: +"The session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use."
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description goes far beyond them: it discloses the conservative skip policy and enumerates the exact skip cases (ControlTemplate, runtime DataContext, keyed resources, unverifiable external base), states that source-generated and inherited members count as resolved, and warns 'A hit is evidence to verify at its line, not proof'. It also flags the stale-snapshot caveat ('a recalled snapshot reports none') and the separate x:Bind per-segment semantics, which no annotation conveys.

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?

The core definition and sibling routing are front-loaded in the first two paragraphs, and no sentence is filler — every clause carries a policy, a skip rule, or a return-field meaning. It is, however, extremely dense: long run-on sentences with stacked parentheticals (e.g. 'a DataType-less template unless - WPF only - its host's ItemsSource types it') cost readability, and the granular output-field enumeration could be tightened.

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?

There is no output schema, so the description carries the full return-value burden and does so: it names count, unresolvedBindings with per-entry fields (view, viewModel, member, line), markupFilesScanned, bindingSitesInMarkup, sitesJudged/sitesSkipped/sitesSkippedBy, judgementNote, sitesSkippedByView, and the parallel xBind* fields. It also scopes framework support (WPF/WinUI .xaml, Avalonia .axaml) and the view-model resolution conventions, leaving nothing material an agent needs before calling it.

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?

With a single parameter at 100% schema coverage, the schema already explains that sessionId is the analyze_solution id and also accepts an absolute .sln/.slnx/.slnf path. The description reinforces the session lifecycle ('refresh_session after edits', recalled sessions reporting null counts), which gives the parameter real operational meaning rather than leaving it as an opaque id.

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?

The description opens with a precise verb+resource and an operational definition of the defect class: 'List silently broken XAML bindings: a {Binding X} whose root member does NOT exist on its confidently resolved DataContext view-model (typo, removed/renamed member, or wrong DataContext)'. It immediately names the sibling boundary ('Where a member or a resource key is bound: find_binding_usages / find_resource_usages'), so an agent can distinguish it from those tools without opening any schema.

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?

It states the triggering situation explicitly ('Use it after renaming or removing view-model members') and routes adjacent questions to named alternatives (find_binding_usages / find_resource_usages), plus a lifecycle rule ('LIVE analysis only: refresh_session after edits'). It also bounds what the tool judges ('judges a binding path's ROOT member only'), which functions as a when-not-to-use condition for non-root breakage.

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