Skip to main content
Glama

Press Key

press_key

Simulate a single keypress or key combination (e.g., Return, Tab, ctrl+c, alt+F4) to control desktop applications and automate keyboard input.

Instructions

Press a key or combo (xdotool names: Return, Tab, Escape, F5, 'ctrl+c', 'alt+F4'). See key_reference for valid names.

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

Input Schema

NameRequiredDescriptionDefault
keyYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden and largely does not meet it. It never says which window or application receives the keystroke (presumably the focused one), whether an active window is required, whether the call blocks, or what happens if the key name is invalid — all critical for an input-simulation tool.

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, zero filler, and the operative instruction ('Press a key or combo') is front-loaded ahead of the format examples. The example list is compact and directly serves the parameter.

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?

An output schema exists, so return values need no explanation, and the key-name format is covered. What is missing is the targeting context — which window receives the input — which is essential for a GUI automation tool with no annotations to fall back on.

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 coverage is 0% (the single 'key' property has no description), so the description must compensate, and it partly does by showing the expected xdotool name format and pointing to key_reference for the valid set. It still omits any fallback behavior for unrecognized names and whether case matters, so the compensation is meaningful but incomplete.

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?

States a specific verb and resource ('Press a key or combo') and immediately grounds it with concrete xdotool-style examples ('ctrl+c', 'alt+F4'), so an agent knows exactly what the tool does. It stops short of distinguishing itself from the sibling send_key_combo, which by name appears to overlap, leaving that differentiation to inference.

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

Usage Guidelines3/5

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

The description gives one genuinely useful usage pointer — 'See key_reference for valid names' — which routes the agent to the right helper before calling. However, it offers no when-to-use/when-not guidance and no comparison to send_key_combo, so the agent must guess which of the two key-input tools to pick.

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