Skip to main content
Glama

press_keys

Destructive

Press a key, key combination, or space-separated sequence in a sandboxed X11 instance; all keysyms are validated before input so invalid names press nothing.

Instructions

Press a key, a combo, or a SEQUENCE (xdotool keysym syntax, space-separated for sequences): 'Return', 'ctrl+a', 'Tab', 'ctrl+t', 'F5', 'ctrl+a Delete', 'alt+F4', 'shift+Insert'.

Returns {"ok", "action", "instance", "detail", "keys": [...]}. Every token is validated against the X keysym table BEFORE anything is pressed, so an invalid name fails with nothing pressed — also in the middle of a sequence. Fails (isError) on a dead instance or a frozen display. Browser navigation: 'ctrl+l' → type_text(url) → 'Return' (or browser(action= 'navigate')). observe/settle_ms: see click().

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

Input Schema

NameRequiredDescriptionDefault
keysYes
observeNonone
instanceNo
settle_msNo
observe_regionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.1
    • addedInput schema / properties / observe_region
      Added value: +{
      +  "default": "",
      +  "title": "Observe Region",
      +  "type": "string"
      +}
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations declare a destructive, non-read-only, open-world action; the description adds the non-obvious guarantees on top: every token is validated against the X keysym table before any keypress, so invalid names fail atomically even mid-sequence. It also names the failure modes (dead instance, frozen display → isError) and pins the return shape, which no output schema otherwise provides.

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 core action and examples, then validation guarantees, then failure modes, then the workflow note. Dense but every clause carries information; only the '(' or browser(action='navigate')' aside and the parenthetical xdotool reference add slight clutter.

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?

Covers syntax, atomicity, failure modes, return shape, and sibling routing — enough for an agent to call it correctly without an output schema. The missing piece is semantic coverage of instance and observe_region, which are neither in the schema descriptions nor the tool description.

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 carries the load, and it explains the one required parameter thoroughly: xdotool keysym syntax, '+' combos, space-separated sequences. observe and settle_ms are handled by reference to click() rather than explained here, and instance and observe_region receive no coverage at all — a real gap given the zero-coverage schema.

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 — press a key, combo, or space-separated sequence — and immediately grounds it in xdotool keysym syntax with concrete examples ('ctrl+a', 'alt+F4', 'ctrl+a Delete'). It separates itself from type_text (typing) and browser(action='navigate') by naming the exact workflow where each applies.

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 recommended path for browser navigation ('ctrl+l' → type_text(url) → 'Return') and names the alternative (browser navigate). It does not spell out when NOT to use press_keys — e.g. multi-character literal text should go to type_text — that has to be inferred from the examples.

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