Skip to main content
Glama

press_key

Presses a key with optional modifiers in a specified or focused browser element, triggering default actions like Enter submitting or Tab moving focus. Use fill_input for typing text.

Instructions

Presses one key, with modifiers (Control+a, Shift+Tab), as a user would, in the element given (focused first) or the focused one; the browser's default action runs (Enter submits, Tab moves the focus). With Control, Alt or Meta held nothing is typed. To type text use fill_input. A dialog or breakpoint it causes is noted, as for click_element.

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
keyYesOne character or Enter, Tab, Escape, Backspace, Delete, ArrowLeft, ArrowUp, ArrowRight, ArrowDown, Home, End, PageUp, PageDown, Insert, Space, F1-F12; optionally after modifiers joined with '+' (Control+a, Shift+Tab, ControlOrMeta+c: Meta on macOS, else Control).
tab_idNoDefault: the active tab.
selectorNoElement to focus first (CSS, 'host >>> inner' or a snapshot ref). Default: the focused element.
modifiersNoKeys held while it is pressed.
instance_idNoDefault: 'default'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0-rc.1

TDQS

A4.3/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full load, and it does disclose real behavior: the browser default action fires (Enter submits, Tab moves focus), modifier-only presses type nothing, and any dialog or breakpoint it triggers is noted in the style of click_element. It does not say what a call returns on success or how an invalid key or missing selector surfaces as an error.

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 core behavior is front-loaded in the first clause, with the conditional cases and the alternative tool following. It stays dense without padding, though the parenthetical asides make the single long sentence somewhat harder to scan than a short list would be.

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 five-parameter tool with no annotations and no output schema, the definition covers the mutations an agent might not expect (default actions firing, dialogs/breakpoints produced) and points to the right sibling for typing. The remaining gap is the return value, which the absent output schema leaves undocumented.

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 100%, so the reader already has key name formats, selector syntax, tab_id and instance_id defaults, and the modifier enum. The description restates modifier syntax with examples but adds little beyond the schema, which is the expected baseline when the schema does the heavy lifting.

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 definition gives a precise verb and resource ('presses one key, with modifiers') and spells out scope: acts on the element given (focused first) or the focused one, and the browser's default action runs. It differentiates itself from the sibling fill_input by name, so an agent can route between them without opening either schema.

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?

It names the alternative explicitly ('To type text use fill_input') and states the condition that selects it. It also gives a when-not hint: with Control, Alt or Meta held nothing is typed, which heads off a common misuse.

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