Skip to main content
Glama

qt_find_widget

Search a running Qt app's widget tree by fuzzy text, class, object name, or semantic description to locate labels, buttons, and fields. Results are ranked and registered as refs usable by click and type tools.

Instructions

Search the widget tree for widgets matching criteria. Prefer over qt_snapshot.

Two modes. With describe and/or window_title it is a semantic search: describe is matched fuzzily (typos, punctuation and case ignored) against label/button text, group and dock titles, tooltip, what's-this, status tip, accessible name/description, objectName, placeholder, tab titles, dynamic properties, class name and style sheet; results are ranked with the reason each matched. Otherwise the plain substring filters below apply.

Registers found widgets in the ref registry — returned refs are immediately usable with qt_click, qt_type, qt_get_text, etc.

Args: pattern: Case-insensitive substring matched against class name, objectName, or text content (OR logic across fields). class_name: Exact class name, case-insensitive (e.g. 'QLineEdit', 'QPushButton', 'ControlWidget'). Must match the full class name, not a substring. object_name: Substring match on objectName. text: Substring match on widget text/label content. root_ref: Restrict search to subtree of this widget. visible_only: Only return visible widgets (default True). max_results: Cap on results returned (default 20). describe: Free-text description, e.g. 'Name goes here:' or 'save the profile'. window_title: Fuzzy match on the top-level window title (e.g. 'PIPE-1234'). search_fields: Limit describe to some of: text, title, placeholder, tooltip, whats_this, status_tip, accessible_name, accessible_description, object_name, window_title, tab_text, properties, class_name, style_sheet. min_score: Minimum semantic match score 0-1 (default 0.5).

At least one of pattern, class_name, object_name, text, describe or window_title must be provided.

Input Schema

NameRequiredDescriptionDefault
textNo
patternNo
describeNo
instanceNo
root_refNo
min_scoreNo
class_nameNo
max_resultsNo
object_nameNo
visible_onlyNo
window_titleNo
search_fieldsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and largely succeeds: it discloses the side effect that found widgets are registered in the ref registry and that returned refs are immediately usable with qt_click, qt_type, and qt_get_text. It also explains ranking output ('reason each matched'). It stops short of stating cost/performance characteristics or whether the registry entries expire, which would matter for a discovery tool.

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

Conciseness5/5

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

Front-loaded with purpose and precedence, then the mode distinction, then a scannable Args block. The prose about which fields `describe` searches is dense but earns its place because it cannot be inferred from the schema, and no sentence is filler.

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

Completeness4/5

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

An output schema exists, so return-shape explanation is not required, and the description still usefully notes that results come with match reasons. Modes, argument semantics, and the mutual-requirement are all covered; only the undocumented `instance` parameter leaves a gap an agent could trip on.

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

Parameters3/5

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

Schema description coverage is 0%, so the Args block does substantial work: it defines every filter's matching semantics (substring vs. exact full class name vs. fuzzy) and the enum-like list of allowed search_fields values. However, the `instance` parameter appears in the schema and is never mentioned in the description at all, and it is the most ambiguous parameter (union of string/integer/null) — a real gap given zero schema-level documentation.

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?

States a specific verb and resource ('Search the widget tree for widgets matching criteria') and immediately distinguishes itself from the sibling qt_snapshot. The two-mode split (semantic via describe/window_title vs. substring filters) makes the tool's identity unambiguous before any schema is opened.

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?

Explicitly says 'Prefer over qt_snapshot' and explains which argument combination selects semantic mode versus plain substring mode, plus the at-least-one-argument precondition. It does not, however, contrast against other plausible siblings such as qt_find_anywhere or qt_object_tree, so the routing guidance is clear but not exhaustive.

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