Skip to main content
Glama
m0rvayne

mcp-osascript

press_key

Press a single key or key combination in the active application, with optional modifiers like Command or Shift. Supports characters and named keys such as Return, Tab, Escape, and function keys.

Instructions

Press a single key, optionally with modifiers, in the frontmost application. Accepts any single character, or a named key: return, enter, tab, space, delete, escape, up, down, left, right, home, end, page_up, page_down, f1-f12. Requires Accessibility permission. To enter text use type_text instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesKey name or single character (e.g. "return", "tab", "c", "f5").
modifiersNoModifier keys.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.3

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the Accessibility requirement, which is a key constraint, and implies action on the frontmost app. However, it does not state whether the key press is simulated at the OS level, what happens on failure, or any side effects (e.g., triggering shortcuts). This is adequate but not exhaustive 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 two sentences, front-loaded with the core action and accepted input, then the permission requirement and alternative. No wasted words; every sentence earns its place.

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?

The tool is simple with two parameters and no output schema. The description covers the purpose, input format, permission, and a clear alternative. It omits explicit error behavior or return value, but given the low complexity and absence of an output schema, this is acceptable.

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 description coverage is 100%, so the baseline is 3. The description adds a list of named keys (return, tab, etc.) beyond the schema's examples, but this is largely redundant. It does not add meaning about the modifiers array beyond what the schema provides. No significant semantic enrichment.

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 action (press a key), the target (frontmost application), and the scope (single key with optional modifiers). It also enumerates accepted key names, which helps the agent understand exact input format. It distinguishes itself from type_text, making its purpose unambiguous.

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?

The description explicitly notes the prerequisite of Accessibility permission and directs users to type_text for text entry, giving a clear exclusion. It does not fully enumerate when to prefer this over other sibling tools (e.g., run_shortcut or app_menu), but for a key-press tool this is sufficient guidance.

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