Skip to main content
Glama

mac_key

Destructive

Press a key or modifier chord, e.g. 'return', 'esc', 'cmd-c', 'cmd-shift-v', 'arrow-up'. Named keys (return, esc, tab, space, delete, arrows, home/end, page keys, F1-F16), with or without modifiers, go out as HID key events with each…

Instructions

Press a key or modifier chord, e.g. 'return', 'esc', 'cmd-c', 'cmd-shift-v', 'arrow-up'. Named keys (return, esc, tab, space, delete, arrows, home/end, page keys, F1-F16), with or without modifiers, go out as HID key events with each modifier pressed and released around the key; a chord with cmd or ctrl on a character key (cmd-c, cmd-shift-v) goes out the same way on the key that types that character in the current keyboard layout (no such key: not_delivered, keyboard_layout); a plain character or a shift/alt-only chord is typed through cliclick. Pass app to refuse input unless that app is frontmost (focus guard). A named key for a native frontmost app is posted straight to its pid (route: bgpost — no focus theft); web-engine apps and layout-dependent chords use the engine HID path. Chords that quit, log out, lock, force-quit, delete immediately or empty the Trash (cmd-q, alt-cmd-q, cmd-shift-q, cmd-alt-esc, ctrl-cmd-q, cmd-alt-delete, cmd-shift-delete…) are refused unless force:true.

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": "mac_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
appNo
keyYes
forceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.2.6
    • addedInput schema / properties / force
      Added value: +{
      +  "type": "boolean"
      +}
    • addedInput schema / required
      Added value: +[
      +  "key"
      +]
  2. First observedv0.1.2

TDQS

A3.9/5.0
Behavior5/5

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

Goes far beyond the annotations: it explains HID event ordering (each modifier pressed and released around the key), layout-dependent chord resolution with the not_delivered/keyboard_layout outcomes, the cliclick fallback for plain characters, the bgpost pid route for native frontmost apps that avoids focus theft, and the focus guard. It also enumerates exactly which dangerous chords are refused and that force:true overrides that refusal, which is meaningful context alongside destructiveHint=true.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Strong front-loading with the verb and example keys in the first clause, but the rest is one dense semicolon-chained paragraph mixing routing, layout, and safety policies. The information is nearly all operationally relevant, yet the lack of structure makes it harder to scan than it needs to be.

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 complex tool with no output schema, three undocumented parameters, and non-trivial routing logic, this covers most of what an agent needs: input formats, dispatch paths, failure codes, and safety refusals. Missing pieces are the response shape beyond the two named codes and any permission or focus-precondition caveats.

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

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must carry all three parameters, and it largely does: key gets extensive format and routing semantics, app is explained as a frontmost-app focus guard, and force is explained as the override for refused chords. The gap is that the app value format (name vs bundle id vs pid) is left ambiguous and no examples are given for it.

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 ('Press a key or modifier chord') and immediately grounds it with concrete examples ('return', 'cmd-shift-v', 'arrow-up'). It never names a sibling such as mac_type or browser_press_key, so an agent must infer that this tool is the raw-keystroke path rather than the text-typing path.

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 through detailed mechanics (focus guard via app, force for refused chords) rather than stated as when-to-use guidance. There is no explicit statement of when to prefer this over mac_type for text or browser_press_key for browser contexts, and no stated prerequisites such as accessibility permissions.

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