Repository navigation
Add bounded WPF inspection workflows - #70
Merged
Merged
Conversation
Expose subtree-scoped search, targeted DataContext paths, and batch computed-property inspection with explicit limits and capability gates. Closes #69
There was a problem hiding this comment.
Pull request overview
This PR extends the WPF inspection surface to support bounded, auditable workflows that avoid N+1 calls: subtree-scoped find_elements, batched computed-property inspection across multiple WPF element IDs, and targeted get_data_context projections via dotted propertyPaths. It also introduces agent capability gating for the new protocol features and updates tests/docs to reflect the new one-call workflow.
Changes:
- Add optional
rootlocator support tofind_elementsfor subtree-limited scanning. - Introduce
get_computed_properties_batchend-to-end (contracts, server tools, agent protocol, controller, and agent implementation) with enforced bounds and ordering/ID mapping checks. - Add
propertyPathssupport toget_data_contextto project selected nested values without full graph serialization, plus capability gating and new coverage.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/WpfToolsMcp.SnapshotTests/ToolProfileTests.cs | Updates tool profile expectations and adds integration tests covering subtree search, batch computed properties, and propertyPaths. |
| tests/WpfToolsMcp.SnapshotTests/InspectionResponseMetadataWpfTests.cs | Adds unit coverage for propertyPaths getter caching behavior and unresolved path warnings/limits. |
| tests/WpfToolsMcp.SnapshotTests/InspectionResponseContractTests.cs | Validates capability-gating behavior for the newly added bounded inspection features. |
| src/WpfToolsMcp.TestApp/MainWindow.xaml | Adds an AutomationId to enable deterministic subtree-root selection in tests. |
| src/WpfToolsMcp.McpServer/Tools/CoreTools.cs | Adds root to find_elements, adds propertyPaths to get_data_context, and exposes get_computed_properties_batch. |
| src/WpfToolsMcp.McpServer/Tools/AgentTools.cs | Mirrors CoreTools changes for agent-backed tool surface (including batch + propertyPaths). |
| src/WpfToolsMcp.Contracts/Contracts.cs | Extends contracts with GetComputedPropertiesBatch* types and shared limits (ComputedPropertiesBatchLimits, DataContextPropertyPathLimits). |
| src/WpfToolsMcp.Automation/AutomationController.Agent.cs | Implements batch property inspection orchestration, capability gating, ordering checks, and public ID remapping. |
| src/WpfToolsMcp.AgentProtocol/ProtocolMessages.cs | Adds new agent protocol capability names for batch computed properties and DataContext property paths. |
| src/WpfToolsMcp.Agent/WpfVisualTreeInspector.cs | Implements propertyPaths normalization/projection and agent-side batch computed properties execution. |
| src/WpfToolsMcp.Agent/AgentServer.cs | Routes the new batch protocol method to the inspector. |
| README.md | Documents the new batch inspection capability and propertyPaths option at a high level. |
| docs/tool-guide.md | Expands the inspection workflow guidance to include subtree roots, batch computed properties, and targeted DataContext paths. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Use an existing element as the subtree root so the new test does not alter unrelated visual-tree snapshots.
A dotted path needs at least one readable segment, so reject propertyPaths when maxDepth is zero.
auto-merge was automatically disabled
August 26, 2026 22:49
Pull request was closed
mkajander
enabled auto-merge (squash)
August 26, 2026 22:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
find_elementstool accept a bounded subtree root.get_computed_properties_batchfor named properties across a bounded list of WPF element IDs.propertyPathsprojections toget_data_context.Scope decision
This change uses batch inspection instead of computed-property predicates in
find_elements. Predicate equality needs a separate contract for WPF-only routing, unset values, converters, brushes, and application-defined objects. The batch tool removes the N+1 MCP calls without introducing unclear comparison rules.Verification
The full test suite is left to CI as requested.
Closes #69