Skip to main content
Glama

Keyboard shortcut

keyboard
Destructive

Use this when the task calls for shortcuts and individual key presses such as Ctrl/Cmd+C, Tab, Enter or Escape. Do not use it to enter normal prose when type_text is available. On Wayland auto uses an already-authorized portal; backend=portal explicitly requests consent.

Input Schema

NameRequiredDescriptionDefault
appNoOptional target application/process name substring.
keyNoSingle key name such as Enter, Escape, Tab or A.
pidNoOptional target process id.
keysNoOrdered key names that together form the requested shortcut or key sequence.
titleNoOptional target window title substring.
deviceYesReMCP device id returned by list_devices. Required for every device operation.
backendNoInput backend preference. auto uses proven local backends and already-authorized portal input; portal explicitly requests XDG RemoteDesktop consent on Wayland; x11 forces XWayland/xdotool only for operations where read-back testing shows it is reliable. GNOME Wayland keyboard/text deliberately reject x11.
shortcutNoKeyboard shortcut such as CTRL+L, CMD+K or ALT+F4.
window_idNoOptional target window id returned by list_windows. On Wayland the target is focused and verified before keyboard/text input is dispatched.

Output Schema

NameRequiredDescriptionDefault
dataNoKeyboard shortcut structured result for keyboard. Stable fields are declared explicitly; platform-specific fields may be added. Large results may return truncated/bytes/preview instead of the full payload.
textYesConcise human-readable result of the tool call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Changed1 schema field changed
    • changedInput schema / properties / window_id / description
      Previous value: -"Optional target window id returned by list_windows. Useful for deterministic XWayland keyboard input on Wayland."New value: +"Optional target window id returned by list_windows. On Wayland the target is focused and verified before keyboard/text input is dispatched."
  4. First observed

TDQS

A4.6/5.0
Behavior4/5

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

The description adds meaningful behavioral context beyond annotations by explaining that on Wayland 'auto uses an already-authorized portal' while 'backend=portal explicitly requests consent.' The annotations already convey mutability and destructive potential (readOnlyHint=false, destructiveHint=true), so the description doesn't need to restate those. It is consistent with the annotations.

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?

Three sentences, no fluff, with the most important guidance front-loaded. It communicates usage boundaries and a platform-specific caveat in a compact, skimmable way.

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?

Given the 9-parameter schema and output schema, the description covers the key decision an agent faces (keyboard shortcuts vs prose) and the main platform nuance (Wayland portal behavior). It doesn't explain how to select among shortcut, key, and keys or how targeting parameters interact, but the rich schema and output schema carry that load.

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 schema already documents all parameters. The description still adds value by giving concrete examples of accepted key/shortcut values (Ctrl/Cmd+C, Tab, Enter, Escape) and by adding meaning to the backend parameter with the Wayland portal distinction.

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?

The description clearly states the tool's purpose: sending shortcuts and individual key presses like Ctrl/Cmd+C, Tab, Enter, or Escape. It names the resource (keyboard input) and explicitly contrasts with type_text, making it easy for an agent to distinguish this tool from siblings.

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?

It explicitly says when to use this tool ('when the task calls for shortcuts and individual key presses') and when not to use it ('Do not use it to enter normal prose when type_text is available'). It also gives backend selection guidance for Wayland, which helps the agent choose the right invocation.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources