Skip to main content
Glama

Find XAML Binding Usages

find_binding_usages
Read-onlyIdempotent

List XAML/AXAML {Binding} sites that name a member path, showing what each resolves against, or inventory all bound members. Use before renaming or deleting a view-model member.

Instructions

List the {Binding ...} sites in the solution's .xaml and .axaml markup that name a member path, with what each one resolves against. find_usages carries a markup edge for a root member bound against the DataContext; this tool lists every site, redirected bindings included. find_unresolved_bindings checks whether a bound member exists on its view-model.

Use it before renaming or deleting a view-model member.

With a path: sites (view, line, path, form), siteCount, byForm, deeperSegmentSites + deeperSegmentSiteCount, pathlessBindingCount, scannedFileCount, sitesTruncated and a note. form is dataContext (no redirect), elementName, relativeSource or source. A path matches as the whole path or as its ROOT segment: 'Foo' finds {Binding Foo} and {Binding Foo.Bar}. The 'Bar' of {Binding Foo.Bar} is a member of Foo's type and is reported apart in deeperSegmentSites. On an elementName or relativeSource binding a leading 'DataContext.' is the hop to the element's view-model: {Binding DataContext.Cmd, RelativeSource=...} is a site of 'Cmd'.

Without a path: the inventory - members (member, siteCount, byForm), most-bound first, with distinctMemberCount and totalSiteCount. Lists are capped at 200; the counts are true totals. pathlessBindingCount is every binding without a plain member root (an empty {Binding}, {Binding Mode=OneWay}, an attached-property path); it counts the whole solution, whatever scope and form say.

The markup is read from disk at every call, so a markup edit needs no refresh_session. Only the {Binding} markup extension is read ({CompiledBinding} too in .axaml): a binding built in code-behind, element-syntax , {x:Bind}, {TemplateBinding} and a path assembled at runtime are invisible here - zero sites means 'verify before renaming or deleting', not proof.

Read-only; test projects are scanned too. path is a case-sensitive markup path and is not resolved as a symbol. An unknown form matches nothing, and the note says so. scope is 'solution' or a substring of the view path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formNoOptional form filter: 'dataContext', 'elementName', 'relativeSource' or 'source'. Omit for all forms. Applies to both views.
pathNoThe exact (case-sensitive) bound member path, e.g. 'GestureLabel' or 'Foo.Bar'. Omit for the inventory view (every bound root member with its site counts).
scopeNo'solution' (default) or a view-path substring (e.g. 'AIContextBuilder.UI/Views/Dialogs') to narrow which markup files are reported.solution
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. Changed2 schema fields changedv0.5.46513
    • changedInput schema / properties / path / description
      Previous value: -"The exact (case-sensitive) bound member path, e.g. 'GestureLabel' or 'Foo.Bar'. Omit for the inventory view (every bound path with its site counts)."New value: +"The exact (case-sensitive) bound member path, e.g. 'GestureLabel' or 'Foo.Bar'. Omit for the inventory view (every bound root member with its site counts)."
    • 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 already declare read-only/idempotent/non-destructive, and the description adds substantial context beyond them: markup is re-read from disk each call so no refresh_session is needed, only the {Binding} markup extension (plus {CompiledBinding} in .axaml) is visible and code-behind/element-syntax/{x:Bind} bindings are invisible, lists are capped at 200 while counts are true totals, and test projects are scanned. This is rich disclosure well beyond the annotation set.

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?

It is long, but front-loaded with purpose and routing first, then output shape with/without path, then caveats, then param notes – each block carries distinct information. The final paragraph mildly restates schema content (case-sensitivity, scope values), which costs a point but does not obscure the structure.

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 must carry the return contract, and it does: it enumerates sites/siteCount/byForm/deeperSegmentSites/pathlessBindingCount/scannedFileCount/sitesTruncated for the path view and members/distinctMemberCount/totalSiteCount for the inventory view, plus the truncation caveat. Nothing needed to invoke or interpret the tool 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%, so the baseline is 3, but the description adds real meaning the schema lacks: path matches the whole path or its ROOT segment ('Foo' finds {Binding Foo} and {Binding Foo.Bar}), the 'Bar' of Foo.Bar is reported separately in deeperSegmentSites, a leading 'DataContext.' on elementName/relativeSource is a hop, path is not resolved as a symbol, and an unknown form matches nothing. Some overlap with the schema's own field descriptions keeps it from a 5.

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 states a specific verb and resource – listing {Binding ...} sites in the solution's .xaml/.axaml markup that name a member path. It immediately distinguishes itself from find_usages ('carries a markup edge for a root member bound against the DataContext; this tool lists every site, redirected bindings included') and find_unresolved_bindings, so an agent can select it 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 provides explicit routing rules against two named siblings and a concrete trigger: 'Use it before renaming or deleting a view-model member.' It also states when zero results are meaningful ('zero sites means verify before renaming or deleting, not proof'), which is exactly the exclusion guidance an agent needs.

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