Skip to main content
Glama

safari_native_keyboard

OS-level keyboard event via macOS CGEvent — sends a real keypress (with optional modifiers) to the Safari window WITHOUT activating Safari or stealing focus.

Instructions

OS-level keyboard event via macOS CGEvent — sends a real keypress (with optional modifiers) to the Safari window WITHOUT activating Safari or stealing focus. Use when safari_press_key's JS path doesn't reach React trust-gated handlers (Discord ProseMirror Enter, Slack send, virtualized editors). Keys: enter, return, tab, escape, space, delete, backspace, up/down/left/right, home, end, pageup, pagedown, f1-f6, a-z, 0-9 and common punctuation. Modifiers: cmd, shift, alt, ctrl. Produces isTrusted:true events. Never activates Safari — runs entirely in the background.

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

Input Schema

NameRequiredDescriptionDefault
keyYesKey name: enter, escape, tab, space, arrow keys, letters, digits, etc.
receiptNoTab receipt from safari_new_tab — pins this call to that tab (survives reconnects/subagents)
modifiersNoModifier keys: cmd, shift, alt, ctrl

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.24.1
    • addedInput schema / properties / receipt
      Added value: +{
      +  "description": "Tab receipt from safari_new_tab — pins this call to that tab (survives reconnects/subagents)",
      +  "type": "string"
      +}
  2. Addedv2.11.6
  3. Removedv2.11.3
  4. Addedv2.10.9
  5. Removedv2.10.8
  6. Addedv2.10.5
  7. Removedv2.10.4
  8. Addedv2.1.7

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and handles it well: it discloses the CGEvent mechanism, that it does not activate Safari or steal focus, that it produces isTrusted:true events, and that it runs in the background. It omits operational prerequisites (macOS accessibility/assistive-access permissions) and any failure mode, which keeps it short of a 5.

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?

Front-loads the mechanism and the differentiator, then the key/modifier lists. Mild redundancy: 'WITHOUT activating Safari or stealing focus' is restated at the end as 'Never activates Safari — runs entirely in the background', which spends a sentence on already-established information.

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 3-parameter input-only tool with no output schema, the description covers mechanism, effect, and key vocabulary, but says nothing about required system permissions, what happens if the target field isn't focused, or what error surfaces on an unsupported key. These gaps matter for an OS-level input-injection tool.

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 100%, so the baseline is 3, but the description adds real meaning beyond the schema by enumerating the accepted key vocabulary (enter, return, tab, escape, space, delete, backspace, arrows, home/end, pageup/pagedown, f1-f6, a-z, 0-9, punctuation) and the four modifiers where the schema has no enums. The receipt parameter is left entirely to the schema, which is acceptable.

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 mechanism ('OS-level keyboard event via macOS CGEvent — sends a real keypress (with optional modifiers) to the Safari window') and explicitly distinguishes itself from the sibling safari_press_key (JS path). An agent can tell them apart 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 an explicit selection rule: use this when safari_press_key's JS path doesn't reach React trust-gated handlers, with concrete examples (Discord ProseMirror Enter, Slack send, virtualized editors). It names the alternative and the condition that selects it.

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

Deploy Server

Other Tools