Skip to main content
Glama

press_keys

Sends single keys or keyboard chords to a specified Windows window, using background input by default and guarded focus handling for targeted automation.

Instructions

Press a key or chord. Requires hwnd/title_contains unless allow_global=True.

Single keys default to background WM_KEYDOWN/WM_KEYUP; chords use guarded SendInput with focus restore.

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
hwndNo
keysYes
modeNobackground
focusNo
allow_globalNo
user_idle_msNo
restore_focusNo
title_containsNo
respect_user_inputNo
require_target_focusNo
wait_for_idle_secondsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.2

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the whole burden, and it does disclose meaningful behavior: single keys use background WM_KEYDOWN/WM_KEYUP while chords use guarded SendInput with focus restore. That is real mechanism-level context, but it leaves the safety-relevant switches (respect_user_input, require_target_focus, focus, user_idle_ms, wait_for_idle_seconds) entirely unexplained.

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 dense sentences, front-loaded with purpose then precondition then mechanism, with no filler. The jargon ("guarded SendInput") is compact and informative rather than wasteful.

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 an 11-parameter input tool with zero schema coverage and no annotations, the description covers only targeting and dispatch mechanism. An output schema exists so return values need not be described, but the idle/respect/focus gating parameters are undocumented anywhere, leaving the agent unable to reason about side effects on the live user.

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 0% across 11 parameters, so the description must compensate and largely does not. It implicitly covers keys, hwnd, title_contains, allow_global, restore_focus and mode ("background"), but six behaviorally significant parameters -- focus, user_idle_ms, respect_user_input, require_target_focus, wait_for_idle_seconds, and mode's allowed values -- get no semantics at all.

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?

"Press a key or chord" gives a specific verb and resource, and the split between single keys and chords signals it is not the same as bulk text entry (type_text). It stops short of explicitly naming a sibling or its boundary condition, so it is clear but not fully differentiated.

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?

It states a hard precondition -- hwnd/title_contains required unless allow_global=True -- which is genuinely useful routing information. However, it never says when to prefer this over type_text or click, or when chords vs. single keys are appropriate beyond the mechanism note, so usage is only implied.

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