Skip to main content
Glama

cua_keyboard

Send virtual keyboard input to any macOS or Windows app to type text, press keys, or trigger hotkeys without stealing focus or altering the clipboard.

Instructions

Zero-conflict Virtual Keyboard v2.2 for ANY macOS or Windows software. Defaults to input_mode='virtual' (direct background Unicode/CJK injection via macOS postToPid / Windows PostMessage WM_CHAR without clobbering the user's clipboard or stealing focus!). Supports type_text, key_press, hotkey, key_down, key_up, key_hold, and full Numpad keys.

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": {
      "action": "<action>"
    },
    "name": "cua_keyboard"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyNo
pidNo
hwndNo
textNo
actionYes
app_nameNoOptional target app name for virtual keyboard routing.
modifiersNo
input_modeNo'virtual' (default, zero conflict & zero clipboard clobbering), 'saved_restore', or 'physical'.virtual
duration_msNo
use_clipboard_pasteNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.2.0

TDQS

B3.2/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does disclose the most important non-obvious behavior: input is injected in the background via postToPid/WM_CHAR without stealing focus or clobbering the clipboard. It stops short of covering failure modes, required macOS accessibility permissions, or what saved_restore and physical modes actually do to the user's environment.

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 text is dense with useful facts but front-loads marketing framing ('Zero-conflict Virtual Keyboard v2.2', an exclamation point) before the actual capability, and crams everything into two long sentences. It is not padded, but the branding and emphasis waste the most valuable opening position.

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 10-parameter tool with no annotations, no output schema, and only 20% schema coverage, the description is not complete enough: an agent still cannot tell how to target a window (pid vs hwnd vs app_name), what duration_ms controls for key_hold, or when use_clipboard_paste should be enabled.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 20% across 10 parameters, and the description compensates for very little: it lists the action enum values and explains the input_mode default, but leaves key, text, pid, hwnd, app_name, modifiers, duration_ms, and use_clipboard_paste completely unexplained. The three different targeting parameters (pid, hwnd, app_name) and the interaction between use_clipboard_paste and the 'no clipboard clobbering' claim are especially opaque.

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 names a specific resource (a virtual keyboard for macOS/Windows) and enumerates the exact operations it performs (type_text, key_press, hotkey, key_down, key_up, key_hold, Numpad). It is clearly distinguishable from siblings like cua_mouse or cua_clipboard, though it never explicitly contrasts itself with them.

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?

Usage context is implied rather than stated: the tool is for sending keystrokes to 'ANY macOS or Windows software', and the parenthetical on input_mode hints that virtual is the safe default because it avoids clipboard clobbering and focus stealing. There is no explicit when-to-use/when-not-to-use guidance and no routing to alternatives such as physical input or sibling tools.

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