Skip to main content
Glama

keyboard_type

Type text into focused windows, optionally replacing content or using clipboard for special characters. Specify window titles to ensure correct targeting and enable safety checks.

Instructions

Type a string into the focused window. Pass windowTitle to auto-focus the target before typing and enable focus-loss detection (focusLost in response) — eliminates a separate focus_window call. Pass replaceAll:true to Ctrl+A before typing (replace existing content in one call). Prefer set_element_value for form fields. Pass lensId (from perception_register, window lens only) to run safety guards (identity stable, foreground, modal) before typing and receive post.perception state feedback without a screenshot. Caveats: Omitting windowTitle types into whatever window is currently active — if focus may have shifted since your last get_context, pass windowTitle explicitly. Does not handle IME composition for CJK — use use_clipboard=true or set_element_value instead. Text containing em-dash (—), en-dash (–), smart quotes, or other non-ASCII punctuation is automatically rerouted via clipboard (method:'clipboard-auto') to prevent Chrome/Edge from intercepting keystrokes as keyboard accelerators (e.g. address bar hijack). Pass forceKeystrokes:true to disable this auto-upgrade.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe text to type (max 10,000 characters)
narrateNoNarration level. rich includes UIA or browser state diff when supported.minimal
use_clipboardNoIf true, copy text to clipboard and paste with Ctrl+V instead of simulating keystrokes. Use this when typing URLs, paths, or ASCII text into apps with Japanese IME active — prevents IME from converting characters. Default false.
replaceAllNoWhen true, send Ctrl+A to select all existing text before typing. Equivalent to Ctrl+A → keyboard_type in one call (requires field already focused). Default false.
forceKeystrokesNoWhen true, always use keystroke mode even if text contains non-ASCII symbols (em-dash, en-dash, smart quotes, etc.) that would normally trigger auto-clipboard. Default false — auto-clipboard is enabled.
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 typing, and a perception envelope is attached to post.perception on success.
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure and does so comprehensively. It explains safety guards when using 'lensId', focus-loss detection with 'windowTitle', automatic rerouting of non-ASCII text via clipboard, and caveats about IME composition and focus shifting. It also describes the response field 'focusLost' and post-action state feedback. This provides rich behavioral context beyond basic functionality.

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 for a complex tool with 10 parameters and no annotations. It is front-loaded with the core purpose and key features, followed by detailed caveats and parameter interactions. Every sentence adds value, but the structure could be slightly improved by grouping related concepts (e.g., separating core functionality from parameter-specific notes) to enhance readability. It avoids redundancy and is information-dense without being verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (10 parameters, no annotations, no output schema), the description is exceptionally complete. It covers the tool's purpose, when to use it versus siblings, behavioral traits (safety, focus handling, automatic fallbacks), parameter semantics, and important caveats (IME, focus shifts, non-ASCII text). The description compensates fully for the lack of annotations and output schema, providing all necessary context for an agent to use the tool correctly.

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?

The schema description coverage is 100%, so the baseline is 3. The description adds significant value by explaining the semantic purpose and interactions of key parameters beyond their technical definitions. For example, it clarifies that 'windowTitle' enables auto-focus and focus-loss detection, 'replaceAll:true' performs Ctrl+A before typing, and 'lensId' runs safety guards and provides perception feedback. However, it doesn't cover all 10 parameters equally (e.g., 'settleMs', 'trackFocus' are less emphasized), preventing a perfect score.

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: 'Type a string into the focused window.' It specifies the verb ('type') and resource ('focused window'), and distinguishes it from sibling tools like 'set_element_value' and 'clipboard_write' by explaining when to prefer those alternatives. The description goes beyond a basic statement by mentioning the core functionality and key differentiators.

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 this tool versus alternatives. It states: 'Prefer set_element_value for form fields' and recommends 'use_clipboard=true or set_element_value instead' for CJK IME composition. It also explains when to pass specific parameters like 'windowTitle' to handle focus shifts, and when to use 'forceKeystrokes:true' to disable auto-clipboard behavior. This covers both when-to-use and when-not-to-use scenarios with clear alternatives.

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