Skip to main content
Glama

Find Unresolved XAML Bindings

find_unresolved_bindings
Read-onlyIdempotent

Detect silently broken XAML bindings where the root member is missing from the resolved DataContext view-model. Use after renaming or removing view-model members to catch typos and stale bindings.

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 render-smoke tests catch it.

Use it after renaming or removing view-model members. It judges the ROOT member of a binding path 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), or whose view-model has an unverifiable external base, is never flagged. Source-generated ([ObservableProperty]/[RelayCommand]) and inherited members count as resolved. Two measured false-report classes are closed: a HierarchicalDataTemplate's ItemsSource pinned onto its content (8/8 on MahApps.Metro), and a d:DesignInstance hint where code-behind sets DataContext = this (25/25 on a ReactiveUI example; now skipped). A hit is evidence to verify at its line, not proof.

Returns JSON: count and unresolvedBindings (view, viewModel, member, line; one entry per site), plus markupFilesScanned and bindingSitesInMarkup from a live disk walk (a clean zero vs no markup at all). The denominator of count: sitesJudged (root member checked on a resolved type) and sitesSkipped, by reason in sitesSkippedBy (both null on a recalled session); judgementNote names any gap to bindingSitesInMarkup. sitesSkippedByView lists each view's skipped sites by reason with their lines (capped at 100 views): a renamed site listed there was never judged.

Read-only; LIVE analysis only: call refresh_session after edits (a recalled snapshot reports none, and 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.8/5.0
Behavior5/5

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

Annotations only cover read-only/idempotent safety; the description adds substantive behavior beyond that: a stated conservative skip policy enumerating untypeable DataContext scopes, what counts as resolved (source-generated and inherited members), two closed false-report classes, and the live-analysis requirement to call refresh_session after edits. It also sets correct expectations by calling a hit "evidence to verify at its line, not proof."

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 definition and usage trigger before the caveats, and every paragraph maps to a decision the agent must make (scope, skipping, output, staleness). It is dense to the point of heaviness, and the empirical validation asides (8/8 on MahApps.Metro, 25/25 on a ReactiveUI example) are useful for trust but read as promotional detail.

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, and the description compensates by documenting the return shape (count, unresolvedBindings, markupFilesScanned, bindingSitesInMarkup, sitesJudged, sitesSkippedBy, sitesSkippedByView) and what a clean zero versus no-markup result means. For a static-analysis tool with a full skip policy, nothing material an agent needs before calling is missing.

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 100% and already documents sessionId including the absolute .sln path fallback, so the schema carries the syntax burden. The description still adds meaning the schema lacks: that a recalled session can report zero and is marked with a 'note', which changes how the sessionId parameter should be chosen and refreshed before trusting results.

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?

Names a specific verb and resource ("List silently broken XAML bindings") and defines the exact predicate: a {Binding X} whose root member does not exist on a confidently resolved DataContext view-model. It also names the sibling tools it is not (find_binding_usages / find_resource_usages), so an agent can discriminate without opening schemas.

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?

Explicit trigger ("Use it after renaming or removing view-model members") plus explicit routing to alternatives for member- and resource-key lookups. The scope limit ("judges the ROOT member of a binding path only") tells the agent when this tool will not answer the question.

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