Skip to main content
Glama

macos_keyboard_press

Press a single named key or modifier shortcut on macOS, such as Enter, Tab, arrows, F1-F12, Cmd+S, or Cmd+Shift+P. Use it for non-text key actions and keyboard shortcuts.

Instructions

macOS only. Press a single named key, optionally as a shortcut chord with modifiers. Use for keys that are not text (Enter, Tab, Escape, arrows, function keys) and for shortcuts like Cmd+S or Cmd+Shift+P. To type words or symbols, use macos_keyboard_type instead. Requires Accessibility permission.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "key": "<key>"
    },
    "name": "macos_keyboard_press"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesThe key to press by name: Enter, Escape, Tab, Space, Backspace, Delete, ArrowUp/Down/Left/Right, Home, End, PageUp, PageDown, F1-F12, a letter (A-Z), or a digit (0-9).
modifiersNoModifiers held around the key to form a shortcut: Control (ctrl), Shift, Alt (option), Meta (cmd/command). Example: key "S" with modifiers ["Meta"] is Cmd+S. On macOS, Meta is Command.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations supplied, the description carries the burden and delivers the two most important traits: the operation is platform-restricted to macOS and requires Accessibility permission (a real failure mode for an agent). It stops short of saying where the key event lands (the focused app/window) or what happens when permission is absent, which are the remaining behavioral unknowns.

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?

Four short sentences, front-loaded with the platform restriction, then purpose, then the routing rule, then the permission caveat. Every sentence carries distinct actionable information and none repeats another.

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?

For a two-parameter tool with full schema coverage and no output schema, the definition covers platform, permission, invocation form, and sibling delegation. The only gap is focus/targeting semantics — which app receives the keystroke — which matters for correct sequencing with the focus-app sibling.

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 both the key-name list and the modifier vocabulary (Control/Shift/Alt/Meta, Meta=Command) are already documented in structured form. The description's shortcut examples largely restate the schema's own "Cmd+S" example, so it adds little beyond the baseline for a fully-covered 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?

States a specific verb and resource ("Press a single named key, optionally as a shortcut chord with modifiers") and immediately scopes it to macOS. It distinguishes itself from macos_keyboard_type by delegating text/symbol entry to that sibling, so an agent can pick correctly without opening either schema.

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?

Gives explicit positive cases (Enter, Tab, Escape, arrows, function keys, Cmd+S, Cmd+Shift+P) and an explicit negative route: "To type words or symbols, use macos_keyboard_type instead." The Accessibility permission prerequisite is also stated up front, leaving little to infer.

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