Skip to main content
Glama

keyboard_press

Press keyboard keys or combinations in Windows applications, automatically focusing target windows and providing state feedback for improved automation workflows.

Instructions

Press a key or key combination (e.g. 'ctrl+c', 'alt+tab', 'ctrl+shift+s', 'f5', 'escape', 'f1'–'f12'). Pass windowTitle to auto-focus before pressing — eliminates a separate focus_window call. Pass lensId (from perception_register, window lens only) to run safety guards (identity stable, foreground, modal) before pressing and receive post.perception state feedback without a screenshot. Caveats: Omitting windowTitle sends keystrokes to the currently active window — if focus may have shifted since your last observation, pass windowTitle explicitly. win+r, win+x, win+s, win+l are blocked for security. narrate:'rich' adds UIA state feedback for state-transitioning keys (Enter, Tab, Esc, F-keys) only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keysYesKey combo string, e.g. 'ctrl+c', 'alt+tab', 'enter', 'ctrl+shift+s'. Note: win+r, win+x, win+s, win+l are blocked for security.
narrateNoNarration level. rich includes UIA or browser state diff when supported.minimal
windowTitleNoPartial title of the window that should receive keyboard input.
forceFocusNoBypass Windows foreground-stealing protection before focusing.
trackFocusNoDetect if focus was stolen after the action.
settleMsNoMilliseconds to wait before checking post-action state.
lensIdNoOptional perception lens ID. Guards (safe.keyboardTarget) are evaluated before the key press.
Behavior4/5

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

With no annotations provided, the description carries full burden and does well. It discloses security restrictions (blocked Windows keys), safety mechanisms (lensId guards), side effects (auto-focus with windowTitle), and behavioral details (narrate:'rich' adds UIA feedback). It doesn't mention rate limits or error handling, but covers most critical aspects.

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?

The description is appropriately sized and front-loaded with core functionality. Every sentence adds value: key examples, parameter purposes, caveats, and narration details. It could be slightly more structured but remains efficient without wasted words.

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?

For a 7-parameter tool with no annotations and no output schema, the description does well. It covers purpose, key parameters, security restrictions, and behavioral context. It doesn't explain return values or error cases, but given the schema's thorough parameter descriptions, this is reasonably complete.

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 description coverage is 100%, so baseline is 3. The description adds value by explaining the purpose of windowTitle ('eliminates a separate focus_window call') and lensId ('run safety guards... receive post.perception state feedback'), and clarifies narrate behavior for 'rich' mode. It doesn't detail all 7 parameters but provides meaningful context for key ones.

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: 'Press a key or key combination' with specific examples like 'ctrl+c', 'alt+tab'. It distinguishes from sibling tools like keyboard_type (typing text) and mouse actions by focusing on discrete key presses.

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?

The description provides explicit guidance on when to use parameters: 'Pass windowTitle to auto-focus before pressing — eliminates a separate focus_window call' and 'Pass lensId... to run safety guards...'. It also specifies exclusions: 'win+r, win+x, win+s, win+l are blocked for security' and warns about focus shifting.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Harusame64/desktop-touch-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server