Skip to main content
Glama
andresolbach

nodriver-mcp-server

Press key

press_key

Send a key press or keyboard shortcut to the currently focused page element, including proper modifier chords like Control+Shift+R. Not for text entry—use fill or type_text.

Instructions

Send a key press or keyboard shortcut to the page.

Goes to whatever currently holds focus, so click or fill the target element first — with nothing focused the key lands on the document body.

Modifiers are held around the main key with the proper modifier bitmask, so real chords such as Control+A or Control+Shift+R register as shortcuts instead of arriving as unrelated key presses.

For entering text use fill (replaces the field) or type_text (appends to it); this tool is for single keys and shortcuts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesA key or chord, e.g. "Enter", "Tab", "Escape", "ArrowDown", "a", "Control+A" or "Control+Shift+R". Modifiers are Control, Shift, Alt and Meta, joined with +. Named keys: Enter, Tab, Backspace, Delete, Escape, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Home, End, PageUp, PageDown, Space. Any single character works as itself.
browserNoWhich browser to act on. Each name is an independent Chrome, created on first use. Omit for the shared default; parallel agents each need their own name.default
include_snapshotNoAppend a fresh page snapshot to the response. Worth it when this action changes the page and take_snapshot would be your next call anyway — it saves a round trip, at the cost of a much larger response.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.5.0
    • addedInput schema / properties / browser
      Added value: +{
      +  "default": "default",
      +  "description": "Which browser to act on. Each name is an independent Chrome, created on first use. Omit for the shared default; parallel agents each need their own name.",
      +  "type": "string"
      +}
  2. First observedv1.7.2

TDQS

A4.5/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false, openWorldHint=true, idempotentHint=false, and destructiveHint=false, which establish the tool is a non-destructive mutation. The description adds useful behavioral context: focus handling (falls back to document body) and modifier bitmask behavior for chords. It does not mention potential side effects like navigation triggers, but annotations already set expectations for safety.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three short paragraphs with zero fluff. It front-loads the purpose, then explains focus behavior, then gives alternatives. Every sentence earns its place, and the structure is scannable.

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 (keyboard shortcuts, focus dependence, multiple parameters) and rich schema plus output schema, the description covers all critical aspects: focus prerequisite, modifier chord behavior, and clear routing to alternatives. An agent can call it correctly without further inference.

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%, and the parameter descriptions are already detailed (key lists examples and modifiers, browser explains independent Chrome instances, include_snapshot explains its trade-off). The description adds focus and chord behavior, but that is usage guidance rather than parameter semantics. With full schema coverage, the description does not need to compensate.

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 sends a key press or keyboard shortcut to the page, identifying the verb and resource. It distinguishes itself from fill and type_text by explicitly noting 'this tool is for single keys and shortcuts,' which separates it from sibling tools that handle text entry.

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 gives explicit when-to-use guidance: it targets the currently focused element, so the agent knows to click or fill first. It also names alternatives (fill, type_text) and explains when not to use this tool, covering exclusions clearly.

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