Skip to main content
Glama
tiefeiyu
by tiefeiyu

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

TableJSON Schema
NameRequiredDescriptionDefault
detailNoextended
root_idNo
max_depthNo
prop_depthNo
session_idYes
include_hiddenNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden, and it excels: it explicitly states that the tree is written to a file and not in the result, describes the ID lifecycle (previous IDs become invalid), warns about GUI thread freezes and 30s timeouts, and explains the fallback behavior for stale root_id. These are non-obvious, important behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but well-structured: a lead sentence, a note about the output location, parameter explanations, and a clear ID LIFECYCLE section. Every sentence carries essential information, though the density makes it somewhat heavy; still, it earns a high score.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (6 params, resource output, ID lifecycle, GUI thread behavior), the description covers all critical aspects: what is returned, where to read the tree, node fields, parameter semantics, freshness constraints, and side effects. An output schema exists, so not detailing return values is acceptable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does comprehensively. Every parameter is explained with meaning, default, and allowed values (e.g., detail as 'core/extended/full', max_depth as levels, prop_depth as QObject property expansion). This adds far more value than the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a clear, specific verb+resource: 'Capture the UI element tree of the session's windows.' It clearly distinguishes this tool from siblings like qt_screenshot (visual capture) and qt_find_element (search within a tree).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides detailed guidance on parameter usage, including the semantics of detail, include_hidden, max_depth, prop_depth, and root_id. It notes that IDs expire on refresh and that root_id should only be passed when fresh, and warns about hidden elements being rejected by other tools. However, it does not explicitly compare against alternative tools like qt_find_element, so a 4 is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/tiefeiyu/qt-commander'

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