Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
wpf_find_elements_deepA

Deep search for ALL elements matching criteria (no result limit). Requires at least type_name, element_name or text to avoid returning the entire tree. Same filters as wpf_find_elements: type_name (partial match), element_name (x:Name substring), text (visible text content), property_filter, visible_only. Use root_handle to limit scope.

wpf_get_binding_errorsA

List all binding errors captured since application start. Errors are detected via WPF trace listener. Use wpf_clear_binding_errors to reset the list.

wpf_click_elementA

Click a UI element. By default invokes the control's action via UI Automation (works for buttons, menu items, checkboxes, radio buttons, tabs, list items, expanders) without moving the mouse or focusing the window. Set physical=true to perform a real OS mouse click at the element's on-screen position (works on any visible element but moves the cursor and brings the window forward; auto-scrolls the element into view first). click_type: 'single' (default), 'double' (open items), 'right' (context menus) — double and right are always physical. After opening a context menu or dropdown, use wpf_capture_screenshot with mode='screen' to see it. STATE-CHANGING.

wpf_get_bindingsB

Get all data bindings for an element with their status

wpf_select_itemA

Select an item in a ComboBox, ListBox, ListView or TabControl by visible text (item_text, case-insensitive substring) or zero-based index. PREFER this over clicking for dropdowns/lists: it works even when items are virtualized (not yet in the visual tree) and raises proper selection events. On failure the error lists the available items. STATE-CHANGING.

wpf_diffA

Diff two snapshots captured with wpf_snapshot, to measure the effect of a change. Returns a summary (counts) plus, for each element that changed, the exact properties that changed (from → to), keyed by stable element handle; plus elements added or removed between the two snapshots. Use this to verify a planned UI tweak did what you expected (e.g. Margin 0,0,0,0 → 40,40,40,40; Visibility Collapsed → Visible; a child appeared).

wpf_list_processesA

List all running WPF applications available for inspection

wpf_export_treeC

Export visual tree to XAML or JSON

wpf_get_resourcesC

Enumerate resource dictionaries and their contents

wpf_get_element_propertiesC

Get all dependency properties of a UI element

wpf_get_layout_infoC

Get layout information (ActualWidth, ActualHeight, Margin, etc.)

wpf_watch_propertyC

Monitor a property for changes

wpf_highlight_elementC

Visually highlight an element in the running application

wpf_clear_binding_errorsA

Clear the captured binding errors list. Useful before testing specific scenarios.

wpf_set_textA

Set the text/value of a UI element (TextBox, ComboBox, etc.). By default uses UI Automation IValueProvider.SetValue (clean, no focus needed, raises proper events). Falls back to setting TextBox.Text or PasswordBox.Password directly, or a reflected string 'Text' property. Set physical=true to focus the element and type via OS keyboard input (clears existing text with Ctrl+A/Delete first, then types each character; moves window focus). STATE-CHANGING.

wpf_find_elementsA

Query elements across all open windows. Filters combine with AND: type_name (partial match, e.g. 'Button' matches 'System.Windows.Controls.Button'), element_name (x:Name substring), text (visible text content — matches a Button's caption, TextBlock text, Window title, AutomationProperties.Name, ToolTip; case-insensitive substring), property_filter (object of property name → expected value substring, e.g. {"IsEnabled": "True"}), visible_only (exclude collapsed/hidden elements — recommended when looking for something the user can see). PREFER text over dumping the tree: e.g. text='Save' + type_name='Button' finds the Save button directly. Results include text, automationId, isVisible, isEnabled and screenBounds (device pixels) so you can pick the right element without extra calls. Returns up to max_results (default 50).

wpf_revert_propertyA

Undo live property edits made with wpf_set_property. By default reverts the most recent edit; pass element_handle and/or property_name to target a specific one, or all=true to undo every pending edit. Restores whatever held the property before (a binding, a local value, or nothing — falling back to style/inherited/default). Returns how many were reverted and how many edits remain pending.

wpf_get_visual_treeA

Get the visual tree hierarchy. Use root_handle to start from a specific element (from wpf_find_elements). Use max_depth to control depth (1-100, default 25). For deep UIs like AvalonDock, increase max_depth or use root_handle to zoom into a subtree.

wpf_get_stylesC

Get applied styles and templates for an element

wpf_send_keysA

Send a keyboard shortcut / key combination to a WPF element (or to whatever currently has keyboard focus, when element_handle is omitted). Examples: 'Ctrl+S', 'Ctrl+Shift+F', 'Enter', 'Escape', 'F5', 'Alt+F4', 'Win+R'. Modifiers: Ctrl, Shift, Alt, Win. Keys: A-Z, 0-9, F1-F12, Enter, Esc, Tab, Space, Backspace, Delete, Insert, Home, End, PageUp, PageDown, Up, Down, Left, Right. Uses OS keyboard input - brings the target window to the foreground. STATE-CHANGING.

wpf_snapshotA

Capture a snapshot of an element's subtree (layout metrics, visibility, alignment, brushes, text) and store it under a label, to diff later with wpf_diff. Workflow: wpf_snapshot(label='before') → make a change (e.g. wpf_set_property) → wpf_snapshot(label='after') → wpf_diff('before','after') to see exactly what moved. element_handle sets the subtree root (omit for the whole main window); max_depth default 25. Returns the label and how many elements were captured.

wpf_capture_screenshotA

Capture a screenshot of the WPF window or a specific element. Returns an image that can be visually analyzed. Use element_handle to capture a specific element, or omit for the entire window. mode='render' (default) re-renders the visual off-screen — works even if the window is covered, but CANNOT see open Popups, ComboBox dropdowns, context menus or tooltips. mode='screen' captures the actual on-screen pixels (GDI) and DOES include them — use it right after clicking something that opened a popup/menu; requires the window to be visible and unobstructed.

wpf_explain_triggersA

Explain an element's triggers and where a value comes from — for 'why doesn't this trigger fire?' and 'which style/setter set this value?'. Lists the element's Style triggers (walking BasedOn) AND its ControlTemplate triggers (where most visual-state triggers live, e.g. IsMouseOver/IsEnabled on a Button), each EVALUATED against the current state: the condition (property=expected), the property's CURRENT value, whether it matches, whether the trigger is active, and the setters it applies. This tells you a trigger isn't firing because its condition property currently holds a different value. Pass property_name to also attribute that property's effective value to its source: a specific style setter (which style, which setter) or an active trigger (which condition), or local/inherited/default.

wpf_attachA

Attach to a WPF application by process ID or name. Set auto_inject=true to automatically inject the Inspector into processes that don't have it pre-loaded.

wpf_wait_for_elementA

Wait until an element matching the criteria satisfies a condition, polling in the target app so you don't have to sleep-and-retry. Identify the element with type_name, element_name and/or text (same matching as wpf_find_elements). condition: 'visible' (default — element exists and is on screen), 'exists' (in the tree even if not visible), 'enabled' (visible and IsEnabled=true), 'hidden' (no matching visible element — e.g. a spinner disappeared). Returns matched (bool), waited_ms, and matched_handle/element_type when found. Use after a click that triggers async work (dialog opens, spinner clears, button enables) before the next step. timeout_ms default 10000 (max 25000); poll_interval_ms default 250.

wpf_evaluate_bindingA

Explain WHY a property has its current value — the go-to tool for 'why is X empty/wrong/disabled?'. Reports the value source (Local, Style, Binding, Inherited, Default, ...), the effective value, and whether it's animated/coerced. When the value comes from a binding, it also resolves the binding path hop-by-hop against the source (DataContext / ElementName / RelativeSource / Source) and reports each segment's value and type, pinpointing exactly where a broken binding fails (e.g. a null intermediate, or a misspelled property that doesn't exist on the DataContext type). Complements wpf_get_bindings (which lists bindings) by actually evaluating one.

wpf_get_data_contextA

Get the DataContext for an element, including type info, properties, INPC status, and inheritance chain up the visual tree. Essential for diagnosing binding path errors.

wpf_set_propertyA

Live-edit a dependency property on an element at runtime, to test whether a planned UI change is effective without rebuilding. The value is a string converted to the property's type: e.g. property_name='Margin' value='20,0,20,0', property_name='Visibility' value='Collapsed', property_name='Background' value='Red' (or '#FF0000'), property_name='Width' value='300', value='{null}' for null. Returns the coerced value read back and what previously held the property (Binding/Local/Unset). Setting a data-bound property replaces the binding with a local value; wpf_revert_property restores it. Pair with wpf_capture_screenshot to see the effect, then revert. STATE-CHANGING (reversible via wpf_revert_property).

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/faze79/WPFVisualTreeMcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server