Skip to main content
Glama

browser_press_key

Simulate keyboard input by pressing a key or shortcut such as Enter, ArrowDown, or Control+A in a Playwright browser session to trigger navigation, submit forms, or run commands.

Instructions

Press a keyboard key or key combination (e.g. 'Enter', '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": "browser_press_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesKey name or shortcut recognized by Playwright Keyboard.press().
sessionIdNoOptional target browser session ID. If omitted, uses the currently active session (or auto-launches one).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden and falls short: it does not say which page or element receives the keypress, whether the target must be focused, whether unknown key names throw an error, or what the result looks like. Only the schema's sessionId field hints at default session targeting.

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?

One sentence, front-loaded with the action and immediately followed by representative examples. Nothing is redundant and nothing is buried.

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?

The tool is simple (2 params, no nested objects, no output schema), so the definition is close to adequate, but with zero annotations it should say more about focus requirements and failure modes. Session targeting is left entirely to the schema.

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 baseline is 3. The examples of single keys and modifier combinations ('Control+A') do add some meaning about the accepted key-name format beyond Playwright's generic reference, but no other format detail (chord syntax, case sensitivity) is explained.

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 states a specific verb and resource ('Press a keyboard key or key combination') and includes concrete key examples ('Enter', 'ArrowDown', 'Control+A'). It is clearly distinct from pointer siblings like browser_click, but never explicitly contrasts itself with text-entry tools such as browser_fill_form or browser_run_code.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use or when-not-to-use guidance. The examples illustrate key format, not the situations that call for pressing a key rather than filling a field or running code, and nothing says whether an element must already have focus for the press to land.

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