Skip to main content
Glama

press_key

Simulates pressing a keyboard key, optionally on a specific page element, to trigger actions like Enter, Escape, Tab, or keyboard shortcuts in a shared browser tab.

Instructions

Press a key, optionally on an element. Examples: "Enter", "Escape", "Tab", "ArrowDown", "Control+a".

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": "press_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYes
refNoElement ref from the latest snapshot, e.g. "e14".
tabNoTab handle from list_tabs, e.g. "chrome:812". Optional when only one tab is shared.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations, the description carries the full burden. It mentions targeting an element but does not say where keystrokes go when ref is omitted, whether the element must be focused first, whether events are trusted, or what happens on failure.

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?

Two short sentences with the core action front-loaded and examples immediately after. No wasted wording, though the examples could be labeled as key-name format rather than left implicit.

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?

A simple three-parameter action tool with no output schema needs modest coverage, and the description supplies the key-name format. It is still thin on focus behavior, error cases, and the distinction between the ref and tab targeting parameters.

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 coverage is 67% and ref/tab are already documented in the schema. The description does add real meaning for the undocumented key parameter by showing chord syntax ("Control+a") and named keys ("ArrowDown"), compensating for part of the coverage gap.

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?

States a specific verb and resource ("Press a key") plus an optional target element, so the action is unambiguous. It does not differentiate itself from siblings such as click or fill_form, which also interact with elements.

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?

"Optionally on an element" implies two modes (global keypress vs. element-targeted) but never says when to use each or when to prefer click/fill_form instead. Usage is inferable rather than stated.

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