Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ The `core` profile exposes these tools:
| Sessions | `launch_app`, `attach_to_app`, `detach_session`, `close_app`, `terminate_app`, `close_session`, `list_sessions` |
| Windows and screenshots | `list_windows`, `set_active_window`, `take_screenshot`, `take_screenshot_sequence` |
| Inspection | `get_visual_tree`, `find_elements`, `resolve_element`, `get_element_properties`, `get_uia_locators`, `get_uia_tree`, `capture_diagnostic_snapshot` |
| WPF diagnostics | `get_binding_info`, `get_command_info`, `get_binding_errors`, `get_validation_errors`, `get_data_context`, `get_computed_properties`, `get_layout_context` |
| WPF diagnostics | `get_binding_info`, `get_command_info`, `get_binding_errors`, `get_validation_errors`, `get_data_context`, `get_computed_properties`, `get_computed_properties_batch`, `get_layout_context` |
| Interaction | `click_element`, `invoke`, `type_text`, `send_keys`, `set_value`, `select_item`, `realize_item`, `scroll_to_element`, `drag`, `wait_for` |

The `diagnostics` profile adds:
Expand Down Expand Up @@ -198,8 +198,11 @@ screenshots run in separate phases, and the response reports timing skew rather
than claiming cross-backend atomicity.

`get_layout_context` reports bounds, transforms, clipping, nearby visual-tree
context, and Grid allocation. `get_computed_properties` can include dependency
property value-source evidence in the diagnostics profile. These tools report
context, and Grid allocation. `get_computed_properties_batch` reads named
dependency properties for a bounded list of WPF element IDs in one call.
`get_data_context` accepts dotted `propertyPaths` when only a few nested values
are needed. The diagnostics profile can also include dependency-property
value-source evidence in `get_computed_properties`. These tools report
unavailable evidence and truncation instead of filling gaps with inferred
values.

Expand Down
12 changes: 10 additions & 2 deletions docs/tool-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ then inspect a subtree if the first response is too broad.

Use `find_elements` when you know some identity text or control type. Search is
bounded and returns stable ordering, match counts, scan counts, truncation, and
optional element IDs. It is usually cheaper and easier to interpret than a deep
tree dump.
optional element IDs. Pass `root` to keep the scan inside a known subtree. It is
usually cheaper and easier to interpret than a deep tree dump.

`get_element_properties` reads bounded UIA properties and supported patterns.
Use the WPF-specific tools for data that UIA cannot expose:
Expand All @@ -94,6 +94,7 @@ Use the WPF-specific tools for data that UIA cannot expose:
| What validation error is active? | `get_validation_errors` |
| What object is behind this view? | `get_data_context` |
| Where did this dependency-property value come from? | `get_computed_properties` |
| What are the same properties across several elements? | `get_computed_properties_batch` |
| Why is this element clipped, offset, or allocated this size? | `get_layout_context` |
| Which style or template is applied? | `get_style_chain`, `get_template_info` in `diagnostics` |
| Which WPF elements lack useful automation peers? | `uia_coverage_report` in `diagnostics` |
Expand All @@ -103,6 +104,13 @@ formatters can run application code. These tools are read-only in the sense that
they do not intentionally invoke a command or send input. They cannot promise
that target-defined getters are free of side effects.

For repeated controls, call `find_elements` once and pass the returned WPF
element IDs to `get_computed_properties_batch`. The batch reports its applied
element and property limits, scanned and returned counts, and truncation.
For a nested view-model value, pass dotted `propertyPaths` to `get_data_context`
instead of serializing the surrounding object graph. Both operations have hard
request limits and reject malformed or unbounded input.

## Use locators deliberately

Core locators expose `automationId`, `name`, `nameContains`, `className`, `type`,
Expand Down
15 changes: 15 additions & 0 deletions src/WpfToolsMcp.Agent/AgentServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,21 @@ internal static async Task<AgentResponse> HandleAsync(
Ok: true,
Result: JsonSerializer.SerializeToNode(response, JsonOptions));
}, request.Id, cancellationToken);
case AgentProtocolCapabilities.GetComputedPropertiesBatch:
return await RunOnUiAsync(() =>
{
var typedRequest = request.Params?.Deserialize<GetComputedPropertiesBatchRequest>(JsonOptions)
?? new GetComputedPropertiesBatchRequest();

var response = WpfVisualTreeInspector.GetComputedPropertiesBatch(
ownerId,
typedRequest,
cancellationToken);
return new AgentResponse(
request.Id,
Ok: true,
Result: JsonSerializer.SerializeToNode(response, JsonOptions));
}, request.Id, cancellationToken);
case AgentProtocolCapabilities.GetLayoutContext:
return await RunOnUiAsync(() =>
{
Expand Down
Loading
Loading