Tool Reference

June 2, 2026 · View on GitHub

Complete reference for all 131 MCP tools provided by the WpfPilot MCP Server.


Session Management (11 tools)

Tools for attaching to, launching, and managing WPF application processes and windows.

ToolDescription
wpf_list_appsList candidate WPF/Windows desktop processes and top-level windows
wpf_launch_appLaunch app from executable path with optional args and working directory
wpf_attachAttach to a running process/window by PID, process name, or window title
wpf_detachDetach from current app session
wpf_session_statusReturn current attachment, window handle, PID, app state, active window
wpf_focus_windowBring attached app/window to foreground
wpf_list_windowsList top-level, modal, popup, owned, and child windows for attached process
wpf_select_windowSwitch active target window within attached process by title or automation id
wpf_close_windowClose a window through normal close command
wpf_get_window_stateGet minimized/maximized/normal/focused/modal state
wpf_set_window_stateMinimize, maximize, or restore a window

Example

User: "Attach to WPFapp"
→ wpf_list_apps → finds PID 12345 "WPFapp"
→ wpf_attach(processName: "WPFapp")
→ { sessionId: "abc123", processId: 12345, mainWindowTitle: "WPFapp - Main" }

UI Inspection / Snapshots (14 tools)

Tools for capturing and querying the UI automation tree.

ToolDescription
wpf_snapshotReturn compact UI tree for current window
wpf_snapshot_elementReturn subtree for one element by automation id or name
wpf_queryFind elements by AutomationId, name, control type, or class name (first match)
wpf_query_allFind all elements matching criteria
wpf_get_elementResolve a selector to one element and return its properties
wpf_get_propertiesGet full UIA properties for an element
wpf_get_patternsList supported UIA patterns for an element
wpf_get_textGet visible text from element
wpf_get_valueGet value from TextBox, ComboBox, Slider, DatePicker, etc.
wpf_get_stateGet element state: enabled, visible, focused, selected, expanded, checked, read-only, offscreen
wpf_get_boundsGet screen/window-relative bounding box for an element
wpf_get_selectionGet selected item(s) from list/grid/tree/combo
wpf_diff_snapshotCompare two snapshots and report added/removed/changed elements
wpf_watch_ui_changesMonitor UI tree changes for a short interval and report differences

Key Parameters

  • automationId — Preferred selector strategy (most stable)
  • name — Element's accessible name
  • controlType — UIA control type (Button, TextBox, ComboBox, etc.)
  • className — WPF class name
  • maxDepth — How deep to traverse the tree (default: 5)

Actions (26 tools)

Tools for interacting with UI elements — clicking, typing, selecting, dragging.

ToolDescription
wpf_invokeInvoke Button, MenuItem, Hyperlink through UIA InvokePattern
wpf_clickClick element using pattern if available, coordinates as fallback
wpf_double_clickDouble-click element
wpf_right_clickRight-click element to open context menu
wpf_set_valueSet text/value via ValuePattern
wpf_clear_valueClear text/value from element
wpf_type_textType text into focused or selected element via keyboard input
wpf_send_keysSend keyboard shortcuts (e.g., Ctrl+S, Enter, Tab)
wpf_focusMove focus to element
wpf_selectSelect list/grid/tree/combo item by automation id or name
wpf_select_by_textSelect item in a list/combo by visible text
wpf_select_by_indexSelect item by index (marked as brittle)
wpf_toggleToggle checkbox, toggle button, or expander
wpf_checkEnsure checkbox is checked
wpf_uncheckEnsure checkbox is unchecked
wpf_expandExpand combo/tree/expander/menu
wpf_collapseCollapse combo/tree/expander/menu
wpf_scroll_into_viewScroll element into view
wpf_scrollScroll container by direction and amount
wpf_open_menu_pathOpen menu path such as "File > Export > PDF"
wpf_open_context_menu_itemRight-click target and invoke context menu item
wpf_drag_dropDrag source element to target element
wpf_set_sliderSet Slider/RangeBase value
wpf_set_dateSet DatePicker/Calendar date by typing text value
wpf_accept_dialogClick OK/Yes/Accept on current modal dialog
wpf_cancel_dialogClick Cancel/No/Close on current modal dialog

Selector Strategy

Actions resolve elements using this priority:

  1. AutomationId — most stable, survives refactoring
  2. Name — accessible name, may change with localization
  3. ControlType + ClassName — structural, less specific
  4. Index/Coordinates — last resort, marked as brittle

Wait Conditions (11 tools)

Tools for polling until UI reaches a desired state.

ToolDescription
wpf_wait_forGeneric wait: selector exists and/or has specific state
wpf_wait_for_elementWait until element exists (up to timeout ms)
wpf_wait_for_absentWait until element disappears
wpf_wait_for_enabledWait until element is enabled
wpf_wait_for_disabledWait until element is disabled
wpf_wait_for_visibleWait until element is visible/not offscreen
wpf_wait_for_hiddenWait until element is hidden/offscreen
wpf_wait_for_textWait until element text equals or contains expected value
wpf_wait_for_valueWait until element value matches expected
wpf_wait_for_windowWait for a window/dialog with title or automation id
wpf_wait_until_snapshot_stableWait until UI tree stops changing for stabilityMs

Parameters

  • timeoutMs — Maximum wait time (default: 10000ms)
  • intervalMs — Poll interval (default: 200ms)

Assertions (15 tools)

Tools for verifying UI state — useful in test workflows and recording assertions.

ToolDescription
wpf_assert_existsAssert element exists
wpf_assert_not_existsAssert element is absent
wpf_assert_visibleAssert element is visible (not offscreen)
wpf_assert_enabledAssert element is enabled
wpf_assert_disabledAssert element is disabled
wpf_assert_textAssert element text equals, contains, or matches expected
wpf_assert_valueAssert element value equals expected
wpf_assert_checkedAssert checkbox/toggle is checked
wpf_assert_uncheckedAssert checkbox/toggle is unchecked
wpf_assert_no_validation_errorsAssert no validation errors visible in window
wpf_assert_selectedAssert specific item is selected in list/combo/tree
wpf_assert_grid_row_countAssert DataGrid/ListView row count (supports gt, lt, gte, lte)
wpf_assert_grid_cellAssert grid cell contains expected value
wpf_assert_accessibilityAssert accessibility: name/automationId present, keyboard focusable
wpf_assert_snapshot_matchesCompare current UI to baseline snapshot within tolerance

Selectors (6 tools)

Tools for generating, validating, and healing element selectors.

ToolDescription
wpf_build_selectorGenerate stable selector for an element
wpf_validate_selectorTest whether a selector resolves uniquely
wpf_explain_selectorExplain how selector is resolved and why it may be brittle
wpf_rank_selectorsGenerate multiple selectors ranked by stability
wpf_detect_missing_idsFind actionable elements missing AutomationId
wpf_detect_duplicate_idsFind duplicate AutomationIds in current window

DataGrid & Tree (12 tools)

Specialized tools for DataGrid, ListView, and TreeView controls.

ToolDescription
wpf_grid_get_rowsReturn visible DataGrid/ListView rows
wpf_grid_get_columnsReturn column headers and metadata
wpf_grid_get_cellGet cell value by row and column index
wpf_grid_set_cellEdit cell value by row and column index
wpf_grid_select_rowSelect row by index or by cell text
wpf_grid_double_click_rowDouble-click a row by index
wpf_grid_find_rowFind row by column values
wpf_grid_sort_by_columnClick column header to sort
wpf_grid_scroll_to_rowScroll grid until row with given text is visible
wpf_tree_get_nodesReturn visible TreeView nodes
wpf_tree_expand_pathExpand tree path such as "Settings > Network > Devices"
wpf_tree_select_pathSelect tree node by path

Recording & Replay (13 tools)

Tools for recording UI workflows and replaying them deterministically.

ToolDescription
wpf_record_startStart recording UI actions
wpf_record_stopStop recording and return workflow JSON
wpf_record_pausePause the current recording
wpf_record_resumeResume a paused recording
wpf_record_stepManually add a named step/checkpoint
wpf_record_assertionAdd assertion from current UI state
wpf_replayReplay recorded workflow JSON
wpf_replay_stepReplay one step by index or name
wpf_validate_recordingCheck for brittle selectors and missing waits
wpf_optimize_recordingReplace sleeps/coordinates with waits/semantic selectors
wpf_export_testGenerate xUnit + FlaUI test code
wpf_export_recordingExport workflow as JSON
wpf_import_recordingLoad and validate workflow JSON

Workflow JSON Schema

{
  "schemaVersion": "0.1",
  "name": "Create New Project",
  "app": { "process": "WPFapp" },
  "policy": { "allowCoordinateFallback": false },
  "steps": [
    { "action": "click", "selector": { "automationId": "btnNew" } },
    { "action": "set_value", "selector": { "automationId": "txtName" }, "value": "Test" },
    { "assert": "enabled", "selector": { "automationId": "btnSave" } },
    { "action": "invoke", "selector": { "automationId": "btnSave" } }
  ]
}

Test Generation (5 tools)

Tools for generating automated test code from current UI state.

ToolDescription
wpf_export_page_objectGenerate Page Object class from current window
wpf_export_selectorsGenerate selector constants for all identifiable elements
wpf_export_assertionsGenerate assertion helper methods for current form state
wpf_export_test_projectGenerate full test project structure (csproj + base classes)
wpf_generate_smoke_testGenerate smoke test from current window structure

Screenshots & Visual (3+ tools)

ToolDescription
wpf_screenshotCapture current window screenshot (base64 PNG)
wpf_screenshot_elementCapture screenshot of specific element
wpf_capture_failure_artifactsCapture screenshot, snapshot, and diagnostics after failure
wpf_annotate_screenshotCapture screenshot with overlay annotations
wpf_get_cursor_positionGet current mouse cursor position
wpf_highlight_elementFlash-highlight an element for debugging
wpf_compare_screenshotPixel-compare two images and return difference percentage

Accessibility (6 tools)

Tools for auditing accessibility compliance.

ToolDescription
wpf_accessibility_snapshotAccessibility-oriented UI tree with metadata
wpf_check_missing_namesFind controls missing accessible names
wpf_check_missing_help_textFind controls missing HelpText descriptions
wpf_check_tab_orderAnalyze keyboard navigation/tab order
wpf_check_keyboard_accessFind controls unreachable by keyboard
wpf_check_control_patternsEnsure controls expose expected UIA patterns

Policy & Safety (9 tools)

Tools for controlling execution policies, auditing, and data redaction.

ToolDescription
wpf_get_capabilitiesList all available tool categories and their status
wpf_set_policySet execution policy (destructive, timeout, retries, coordinate fallback)
wpf_get_policyGet current execution policy
wpf_preview_actionDry-run: show what an action would do without executing
wpf_confirm_actionExecute a previously previewed action
wpf_clear_audit_logClear the audit log
wpf_redact_snapshotReturn snapshot with sensitive fields redacted
wpf_set_redaction_rulesAdd redaction rules for sensitive patterns
wpf_get_redaction_rulesList current redaction rules

Reporting & Diagnostics (9 tools)

ToolDescription
wpf_get_diagnosticsCombined diagnostic report
wpf_analyze_automation_qualityScore automation quality
wpf_generate_session_reportSession summary
wpf_get_audit_logView audit trail
wpf_generate_testability_reportTestability report with scores
wpf_generate_diagnostics_reportFull diagnostics: audit, session, UI state
wpf_export_artifactsBundle session artifacts as JSON
wpf_import_artifactsLoad artifacts bundle
wpf_compare_reportsCompare two testability reports

Clipboard & Environment (6 tools)

ToolDescription
wpf_get_clipboardGet clipboard text content
wpf_set_clipboardSet clipboard text
wpf_clear_clipboardClear clipboard
wpf_get_current_cultureGet thread culture info
wpf_get_themeDetect Windows theme (dark/light)
wpf_get_screen_infoGet screen resolution and DPI

Probe Management (6 tools)

Tools for managing the optional in-process WPF probe connection.

ToolDescription
wpf_probe_statusCheck if probe is connected and responding
wpf_probe_connectConnect to probe via named pipe
wpf_probe_disconnectDisconnect from probe
wpf_probe_capabilitiesList supported probe methods
wpf_probe_healthRun probe health check
wpf_probe_install_instructionsShow probe installation guide

MVVM Diagnostics (10 tools)

Deep WPF/MVVM inspection via the in-process probe. Requires probe to be installed in target app.

ToolDescription
wpf_get_viewmodelGet ViewModel type and property summary
wpf_get_viewmodel_propertiesGet all ViewModel properties with values
wpf_get_commandsList all ICommand properties
wpf_get_command_stateGet CanExecute state of a command
wpf_execute_commandExecute an ICommand on ViewModel
wpf_get_binding_errorsGet all WPF binding errors
wpf_get_bindingsGet all active bindings
wpf_get_validation_stateGet validation errors
wpf_get_dispatcher_statusGet Dispatcher thread status
wpf_get_datacontextGet DataContext type and value

Example

User: "Why is the Save button disabled?"
→ wpf_probe_connect
→ wpf_get_command_state(commandName: "SaveCommand")
→ { commandName: "SaveCommand", canExecute: false }
→ wpf_get_validation_state
→ { hasErrors: true, errors: [{ message: "Name is required", bindingPath: "Name" }] }
→ "The Save button is disabled because the SaveCommand.CanExecute returns false. 
   There's a validation error: 'Name is required' on the Name property."