Skip to main content
Glama
computer
by zznabil

Hold keys

hold_keys
Destructive

Hold keys down for a specified duration, then release them, to perform gestures that require a key to remain pressed while time passes.

Instructions

Hold keys down for a duration in seconds (0-100), then release them all before the call returns (also on error). For a single chord use press_keys; this is for gestures that need a key held while time passes.

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>",
      "duration": "<duration>"
    },
    "name": "hold_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.
durationYesSeconds to hold, 0 to 100.
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. Addedv0.3.2

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, openWorldHint=true, and non-idempotent, so the risk profile is known. The description adds genuinely new behavior: keys are guaranteed released before the call returns, including on error, which is important for a tool that can leave a modifier stuck down. It does not itself discuss the takeover setting's user-interruption risk, which lives only in the schema.

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?

Two sentences with no waste: the core behavior and the release guarantee come first, and the sibling routing follows as a second clause. Nothing is padded or restated.

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 four-parameter mutation tool with no output schema, the description covers the main non-obvious risk (stuck keys) and the sibling split. Remaining gaps — takeover semantics and response content — are handled by the rich schema or are minor, since a void-style action needs little return explanation.

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 keys, target, duration, and takeover are all documented in structured fields, including the 0-100 bound the description repeats. The description adds no syntax, format, or defaulting detail beyond what the schema already says, so the baseline 3 applies.

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 (hold keys), the scope of the operation (a bounded 0-100 second duration), and the completion guarantee (all keys released before return). It explicitly distinguishes itself from press_keys, so an agent can separate the two 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 Guidelines4/5

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

Gives an explicit routing rule: single chords go to press_keys, while this tool is for gestures needing a key held over time. That is a clear use condition, but it does not cover other nearby choices such as hold_mouse for pointer gestures or when to prefer desktop/display targets over a window target.

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