Skip to main content
Glama

safari_native_keyboard

Sends real OS-level keypresses to the background Safari window without stealing focus, so React trust-gated editors receive isTrusted events when JavaScript key events fail.

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.
whyNoOptional short purpose of this step, shown to the user in the cursor's status pill (e.g. 'to save the settings'). The page can read it: never put passwords, codes, card numbers or other private data in it.
receiptNoOmit it: Daylight has no tab receipts and refuses a call that passes one
modifiersNoModifier keys: cmd, shift, alt, ctrl

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/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 full burden and mostly succeeds: it discloses that the emitted events carry isTrusted:true, that Safari is never activated or focus-stolen, and that it runs in the background. What it omits is the operational cost side — whether macOS Accessibility/Automation permission is required and what happens on an unsupported key name — so an agent cannot predict failure modes.

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-loaded with the mechanism, then the when-to-use rule, then the accepted key/modifier vocabularies — a sensible priority order for an agent. It loses a point for echoing the no-focus guarantee twice, once in the opening clause and again as the trailing 'Never activates Safari' sentence.

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 side-effecting input tool with no annotations and no output schema, the description supplies the essentials: trust semantics, focus-preservation, and the full key vocabulary. The remaining gap is error and permission behavior, which an agent would need in order to recover from a failed call.

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 genuinely enriches the `key` parameter beyond the schema's vague 'etc.' by enumerating the accepted families (f1-f6, a-z, 0-9, punctuation) and listing the four valid modifiers. It says nothing about `why` or the unusual `receipt` parameter, though those are documented in the schema itself.

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 — an OS-level keypress delivered via macOS CGEvent to the Safari window — and immediately frames its relationship to the sibling safari_press_key. The parenthetical about focus behavior and the concrete failure scenarios (Discord ProseMirror Enter, Slack send, virtualized editors) make it distinguishable from every other input tool in the list.

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?

Explicitly names the alternative (safari_press_key's JS path) and the exact condition that selects this tool instead: React trust-gated handlers that reject synthetic JS events. Naming specific real-world editors where the JS path fails turns an abstract exclusion rule into an actionable routing decision.

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