Skip to main content
Glama
computer
by zznabil

Press keys

press_keys
Destructive

Sends a key chord such as ctrl+s or enter to a target window or desktop, enabling keyboard shortcuts and input commands within that scope.

Instructions

Press a key chord in the target window.

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": {
      "target": "<target>",
      "keys": "<keys>"
    },
    "name": "press_keys"
  }
}

Input Schema

NameRequiredDescriptionDefault
keysYesKey chord, e.g. "ctrl+s", "enter", "ctrl+shift+p", or ["ctrl","s"].
targetYesWindow id from list_windows (a "window:<id>" prefix is accepted), "desktop", or "display:<id>" / "display:active" / "display:all". Prefer a window id so the input stays scoped to that window; desktop/display input directly drives the user's pointer and keyboard.
takeoverNoOmit to follow the plugin setting ("prefer" uses real input first, "fallback" tries background input first, "refuse" disables takeover). Use true for reliable input in Chromium (including Brave), Electron, and terminal hosts when takeover is allowed. Takeover brings the window forward and can interrupt the user. For window targets, use false to request background-only input; desktop and display targets send real input.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.11.0
    • changedInput schema / properties / takeover / description
      Previous value: -"Omit (default): background first; the server decides any takeover. true: activate the window and post real input now. false: background only, never take over."New value: +"Omit to follow the plugin setting (\"prefer\" uses real input first, \"fallback\" tries background input first, \"refuse\" disables takeover). Use true for reliable input in Chromium (including Brave), Electron, and terminal hosts when takeover is allowed. Takeover brings the window forward and can interrupt the user. For window targets, use false to request background-only input; desktop and display targets send real input."
    • changedInput schema / properties / target / description
      Previous value: -"Window id from list_windows (a \"window:<id>\" prefix is accepted), \"desktop\", or \"display:<id>\" / \"display:active\" / \"display:all\". Prefer a window id: window input runs in the background; desktop/display input drives the user's real pointer and keyboard."New value: +"Window id from list_windows (a \"window:<id>\" prefix is accepted), \"desktop\", or \"display:<id>\" / \"display:active\" / \"display:all\". Prefer a window id so the input stays scoped to that window; desktop/display input directly drives the user's pointer and keyboard."
  2. Changed1 schema field changedv0.3.3
    • changedInput schema / properties / target / description
      Previous value: -"Window id from list_windows, \"desktop\", or \"display:<id>\" / \"display:active\" / \"display:all\". Prefer a window id: window input runs in the background; desktop/display input drives the user's real pointer and keyboard."New value: +"Window id from list_windows (a \"window:<id>\" prefix is accepted), \"desktop\", or \"display:<id>\" / \"display:active\" / \"display:all\". Prefer a window id: window input runs in the background; desktop/display input drives the user's real pointer and keyboard."
  3. First observedv0.2.0

TDQS

C2.8/5.0
Behavior2/5

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

Annotations already flag this as destructive, non-idempotent, and open-world, so the baseline is lower; the description adds no behavioral context of its own beyond restating the action. It says nothing about focus requirements, the fact that input can interrupt the user, failure modes when a key is unsupported, or what happens if the target window is gone — all relevant for a tool that drives the real keyboard.

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?

The single sentence is front-loaded and wastes no words, but at this length for a destructive input-injection tool it reads as under-specified rather than efficient. There is no structural hierarchy to help an agent scan preconditions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, open-world tool with no output schema, the description is too thin: it never states that keys are sent to the OS-level target, that focus may be stolen, or how tab/window targeting affects behavior. An agent must reconstruct all of that from the schema alone.

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%, and the keys, target, and takeover parameters already carry detailed examples and defaults, so the schema does the heavy lifting. The description adds no additional meaning about key-chord syntax, target resolution, or takeover behavior; baseline 3 applies.

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?

The description states a specific verb and resource ('press a key chord') plus the input target ('in the target window'), so the action is unambiguous. It does not differentiate from near-siblings such as type_text, hold_keys, or element_press_keys, which an agent could easily confuse when deciding how to send keyboard input.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance, no when-not-to-use condition, and no pointer to alternatives like type_text for literal text or element_press_keys for element-scoped presses. The only scoping hints live in the schema's target description, not in the tool description itself.

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