Skip to main content
Glama

Ui Keystroke

ui_keystroke
Destructive

Sends a key combination, e.g. "cmd+shift+5", "return", "cmd+,", "escape". Modifiers: cmd, shift, alt/option, ctrl, fn. The last token is the key. Returns {sent, delivery:"posted_not_confirmed"} — sent means the key events were POSTED, NOT that the app acted on them: CGEvent carries no delivery confirmation, and a keystroke's effect is arbitrary so nothing can be read back to prove it. Confirm the effect with ui_get_element / ui_read_tree rather than trusting sent. Modifiers are released after the combo, so a following ui_type is not swallowed. unknown_key if the key isn't recognized. Requires Accessibility permission.

Input Schema

NameRequiredDescriptionDefault
keysYese.g. cmd+shift+5, return, cmd+,

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnlyHint=false, destructiveHint=true) by disclosing that delivery is "posted_not_confirmed", that CGEvent gives no confirmation, that effects are arbitrary, and that the agent must verify via ui_get_element / ui_read_tree. Also documents the unknown_key error path, modifier-release side effect, and permission requirement.

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 the action and syntax, then delivery caveats, then error/permission notes. Every sentence carries operational information despite the density; nothing is redundant padding.

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

Completeness5/5

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

Even without an output schema, the description documents the return shape ({sent, delivery:"posted_not_confirmed"}), the meaning of `sent`, the error case, and the permission requirement. An agent has everything needed to call it and interpret the result.

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?

Schema coverage is 100%, so baseline is 3, but the description adds real parsing semantics the schema lacks: the allowed modifier aliases (cmd, shift, alt/option, ctrl, fn) and the rule that the last token is the key. That is exactly the missing information needed to construct a valid `keys` value.

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?

Specific verb+resource ("Sends a key combination") with concrete syntax examples ("cmd+shift+5", "return", "cmd+,") and the full modifier set. It also implicitly separates itself from ui_type by noting modifiers are released so a following ui_type isn't swallowed, and from ui_click by being pure keyboard input.

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 tells the agent how to verify results (use ui_get_element / ui_read_tree rather than trusting `sent`) and states the Accessibility permission prerequisite. It does not explicitly name ui_type or ui_click as alternatives with selection criteria, so the when-to-use-vs-sibling guidance is inferred rather than stated.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources