Skip to main content
Glama

qt_trigger_action

Triggers a menu or toolbar action in a running Qt application by display text or zero-based index, enabling automated UI control when you know the action label or order.

Instructions

Trigger a menu action or toolbar action by text or index.

Args: ref: Ref to a QMenu, QMenuBar, QToolBar, or any widget with actions. action_text: The action's display text (e.g., 'Save', '&Open'). Ampersands are stripped for matching. action_index: The 0-based index of the action (matching qt_menu_items order).

Provide either action_text or action_index (not both). Use qt_menu_items first to see available actions.

Input Schema

NameRequiredDescriptionDefault
refYes
instanceNo
action_textNo
action_indexNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

No annotations, so the description carries the burden. It usefully discloses matching behavior (ampersands stripped) and that index corresponds to qt_menu_items order, but omits failure modes, whether the action requires a visible/active widget or menu, what side effects the triggered action causes, and error behavior.

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?

Front-loads the one-line purpose, then enumerates args with just enough detail. The Args block is slightly verbose but each line earns its place; no filler.

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

Completeness3/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 values needn't be explained, and the action-selection parameters are covered. However the undocumented 'instance' parameter and the absence of failure/side-effect disclosure leave meaningful gaps for a mutation-style trigger tool.

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 coverage is 0%, so the description must compensate. It documents ref, action_text, and action_index well, including ampersand handling and index semantics, but completely omits the 'instance' parameter present in the schema, leaving one of four params unexplained anywhere.

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 (Trigger) and specific resource (menu action or toolbar action) with the selection mechanism (text or index). It is distinguishable from siblings like qt_click and qt_invoke_slot, which operate on widgets/slots rather than existing actions.

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

Usage Guidelines5/5

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

Explicitly states the alternative invocation modes (action_text or action_index, not both) and routes the agent through qt_menu_items first to discover available actions. This is clear when-to-use guidance with a named prerequisite sibling.

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