Skip to main content
Glama

ie_press_key

Press a key on a specified element or the active element in an IE-mode page to trigger keyboard actions such as Enter, Tab, Escape, or literal characters.

Instructions

Press a key on an element (if by/value given) or the active element. Key names: Enter, Tab, Escape, Space, Backspace, Delete, Up/Down/Left/Right, Home, End, PageUp, PageDown, F5, or a literal character. Over COM (target hwnd:/tab:) the key is posted to the window as WM_KEYDOWN/WM_KEYUP (documentMode 7+), so Shift-modified characters are typed unshifted.

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": {
      "key": "<key>"
    },
    "name": "ie_press_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
byNo
keyYes
waitNo
frameNo
valueNo
targetNoWhere to act: omit it for the session's IE driver; hwnd:<n> acts over COM on the window <n> (a modal dialog's hwnd from a NOTICE or ie_windows), tab:<n> on an attached tab. Over COM, DOM access is script, input is synthetic (script events and a timer click, not mouse or keyboard input; keys are posted window messages) and only id, name, tag, class, link_text and (documentMode 8+) css locators work.
timeoutNoseconds to wait for the element (default 10)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A3.6/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 mostly does: it discloses that over COM the key is posted as WM_KEYDOWN/WM_KEYUP (documentMode 7+), and warns that Shift-modified characters are therefore typed unshifted — a non-obvious and consequential caveat. It does not cover failure behavior when the element is absent, what wait controls, or what the call returns.

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 action and target rule come first, then the key vocabulary, then the COM caveat, so it is well front-loaded. The final sentence is information-dense but each clause (posting mechanism, documentMode gate, Shift caveat) adds distinct meaning. Slightly more structure would help scanability.

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

Completeness3/5

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

This is a seven-parameter tool with no annotations, no output schema, and low schema description coverage, so the description should do more. It handles key naming and COM behavior well but leaves wait, frame, timeout interaction, and error semantics unexplained. Adequate for a simple key press, marginal for the COM mode it documents.

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

Parameters3/5

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

Schema description coverage is only 29%, so by, value, wait and frame are undocumented in structured fields. The description partially compensates by explaining that by/value together locate the element and by specifying the accepted key-name vocabulary for key. It says nothing about frame, wait, or the locator syntax accepted by by, leaving real gaps.

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 verb and resource ('Press a key') and clarifies the target resolution rule: an element when by/value are supplied, otherwise the active element. It also enumerates accepted key names, which pins down the resource precisely. It stops short of explicitly contrasting itself with siblings such as ie_fill or ie_click, leaving that distinction to inference.

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 is implied through the conditional 'if by/value given' clause, which tells an agent how to choose between the two modes. There is no explicit when-to-use vs when-not guidance, no mention of when keyboard input is preferable to ie_fill for text entry, and no prerequisites such as focus being required on the element.

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