Skip to main content
Glama

ui_press_key

Destructive

Focus a visible, enabled UI path, press and release a key with optional modifiers, then read back the resulting state to verify shortcuts or form commits.

Instructions

Focus a required visible, enabled path, press/release a key and read back state. Modifiers: CTL/ALT/SHIFT/MAC_CONTROL. Enter can commit forms. Human input and shortcuts can interfere; verify the result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
keysymYes
modifiersNo
observe_pathNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior4/5

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

Annotations already flag destructive/openWorld/readOnly=false, and the description meaningfully adds preconditions (target path must be visible and enabled), the press/release behavior, side effects ('Enter can commit forms'), and a caveat that human input and shortcuts can interfere. This is substantial added context beyond the annotations, though the return/state read-back is only mentioned, not described.

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?

Three short, front-loaded sentences with no obvious filler; the action, modifiers, and caveats are ordered sensibly. Slightly telegraphic phrasing ('required visible, enabled path') costs a bit of readability.

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 destructive, open-world input tool with no output schema, the description covers preconditions and side effects reasonably but under-documents keysym and observe_path and does not describe what 'read back state' returns. Adequate but with clear gaps that an agent would notice before invoking.

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

Parameters2/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 carry parameter meaning and only partly does: it lists the modifier values (matching the enum) and explains that path must be visible/enabled, but says nothing about the keysym format/syntax or the observe_path parameter at all. Two of four parameters remain undocumented.

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: focus a path, press/release a key, and read back state. This cleanly separates it from siblings like ui_click and ui_set_text, though the terseness of 'Focus a required visible, enabled path' leaves the path concept slightly under-explained.

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

Usage Guidelines2/5

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

No explicit when-to-use or when-to-prefer-alternatives guidance relative to ui_click, ui_set_text, or ui_select. The note that 'Enter can commit forms' and 'verify the result' are behavioral hints, not routing guidance, so an agent gets no help choosing among the sibling UI input tools.

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