Skip to main content
Glama

qt_key_press

Sends a key event such as 'Ctrl+S' or 'Return' to a specific Qt widget or the currently focused widget, letting an AI agent trigger shortcuts and keyboard input in running Qt applications.

Instructions

Send a key event to a widget or the focused widget.

Args: key: Key name (e.g., 'Return', 'Escape', 'Ctrl+S', 'a'). ref: Widget ref. If omitted, sends to the currently focused widget.

Input Schema

NameRequiredDescriptionDefault
keyYes
refNo
instanceNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the target-resolution rule and gives key-name examples, but says nothing about whether the event is synchronous, whether modifiers/hold-repeat are supported, or that arbitrary key events can destructively affect the app (e.g., Ctrl+Q). The output schema relieves it of return-value explanation.

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-loaded with the one-sentence purpose, followed by a compact args block. Every line carries information; the only waste is that the arg list duplicates the `key` name without formalizing the format.

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?

For a tool that fires arbitrary key events, completeness would require stating that the target may need focus and that some keys are destructive. The undocumented `instance` parameter and absent annotation coverage leave gaps, though the existing output schema covers the return side.

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 does add real meaning for `key` (naming 'Return', 'Escape', 'Ctrl+S', 'a') and explains the `ref` default behavior, but the third parameter `instance` is never mentioned anywhere and the modifier syntax is only shown, not specified.

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

Purpose4/5

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

States a specific verb and resource: 'Send a key event to a widget or the focused widget.' The target-resolution behavior (widget ref vs focused widget) is spelled out. It never distinguishes itself from the near-sibling qt_type, which an agent could plausibly confuse with it, so it stops short of a 5.

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

Usage Guidelines3/5

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

Usage is implied: omit `ref` to send to the focused widget. There is no explicit guidance on when to choose key_press over qt_type, qt_click, or qt_trigger_action, and no mention of prerequisites such as the target widget needing focus.

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