Skip to main content
Glama

qt_trigger_action

Trigger menu or toolbar actions in PySide6 applications by text or index to automate UI interactions for testing and debugging.

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

TableJSON Schema
NameRequiredDescriptionDefault
refYes
action_textNo
action_indexNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains that ampersands are stripped for matching and actions are 0-indexed, which are useful behavioral details. However, it doesn't cover potential side effects (e.g., UI changes), error handling, or permissions needed, leaving gaps for a mutation 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?

The description is well-structured and front-loaded with the purpose, followed by parameter details and usage rules. Every sentence adds value: the first states the purpose, the next three explain parameters, and the last two provide usage guidelines. No wasted words.

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?

Given the tool's complexity (triggering UI actions), no annotations, and an output schema (which handles return values), the description is mostly complete. It covers purpose, parameters, and usage well, but lacks details on behavioral side effects and error conditions, which are important for a mutation tool.

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?

The schema description coverage is 0%, so the description must fully compensate. It does so by explaining all three parameters: 'ref' as a reference to UI components, 'action_text' with matching rules, and 'action_index' with indexing details. It also clarifies the exclusive-or relationship between action_text and action_index, adding crucial semantics beyond the 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 clearly states the tool's purpose: 'Trigger a menu action or toolbar action by text or index.' It specifies the exact verb ('trigger') and resources ('menu action or toolbar action'), and distinguishes it from siblings like qt_menu_items (which lists actions) and qt_click (which clicks widgets).

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?

The description provides explicit guidance on when and how to use the tool: 'Provide either action_text or action_index (not both)' and 'Use qt_menu_items first to see available actions.' It also distinguishes from alternatives by referencing the sibling tool qt_menu_items for discovery.

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/0xCarbon/qt-mcp'

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