qt_snapshot
Capture the UI element tree of a Qt application's windows to inspect and automate its interface elements.
Instructions
Capture the UI element tree of the session's windows.
The tree is NOT in this result — it is written to the file exposed at
the returned uri (resource qt-commander://sessions/.../snapshots/ snapshot_N.json); read that resource to inspect the tree. The result
carries only session_id / snapshot_id / uri. Node fields: className,
objID, objectName, rect (window-local logical px), global_rect (screen
coords), z_order, visible/enabled/opacity/color_alpha/clip, text,
topLevelId, windowTitle, properties (per detail).
detail — property tier per node: "core" (first-class fields only,
no properties), "extended" (DEFAULT; common interaction-state
properties like text/checked/value), "full" (every Q_PROPERTY; slow on
large UIs).
include_hidden (default False) — hidden elements are pruned
together with their whole subtree (hidden tabs, unopened dialogs).
Set True to include them; note hidden elements are still rejected by
click/input/property tools.
max_depth — levels of children: 0 = roots only, 1 = roots +
direct children, -1 = entire tree (default 1).
prop_depth — levels of QObject property expansion (0 = none,
-1 = unlimited).
root_id — 0 = all top-level windows; >0 = subtree of an element
from the MOST RECENT snapshot/find. Ids expire on every refresh: if
root_id no longer resolves, the tool silently falls back to all
top-level windows — pass it only when you know it is fresh.
ID LIFECYCLE: this call rebuilds the element map, so every element_id and window_id from previous snapshots/finds becomes invalid. The snapshot runs on the target process's GUI thread (brief UI freeze); if the target is busy, calls can time out after ~30s.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| detail | No | extended | |
| root_id | No | ||
| max_depth | No | ||
| prop_depth | No | ||
| session_id | Yes | ||
| include_hidden | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |