Skip to main content
Glama

Press key

browser_press_key

Press a key or chord on the page or a targeted element to trigger actions such as submitting forms, navigating, or using keyboard shortcuts.

Instructions

Press a key or chord (Enter, Escape, Tab, ArrowDown, Control+a) on an element or the page.

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
keyYes
nthNo
refNoElement ref from snapshot (preferred)
nameNo
roleNo
textNo
exactNo
labelNo
expectNoExpectSpec postconditions
pageIdNo
testIdNo
withinNoScope to a unique container (ref, role+name, label, testId or CSS selector)
sessionNo
selectorNoCSS (last resort)
snapshotNoPage state returned after the action: diff (default), full, none
placeholderNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false and openWorldHint=true, so the safety profile is covered. The description adds useful behavior in the chord syntax (Control+a) and the global-vs-element targeting distinction, but omits key semantics an agent needs: which element receives focus, whether an element ref is required for element-targeted presses, and how the expect postconditions interact with the action.

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?

A single front-loaded sentence with parenthetical examples and no filler; every clause carries information. It is arguably too terse for a 16-parameter tool, but there is no redundant or wasted wording.

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

Completeness2/5

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

For a tool with 16 parameters, nested locator/scope objects, an enum-backed snapshot mode, expect postconditions and no output schema, one sentence leaves major areas unexplained. Nothing tells the agent about focus requirements, when to use within-scoping versus a bare ref, or how session/pageId affect the action.

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 only 31%, but the description does compensate for the most critical gap by documenting the accepted key/chord format for the required 'key' parameter, which has no description in the schema. The other fifteen parameters (nth, expect, snapshot, within, session, pageId, name/role/text/label/testId locators) receive no explanation, though the schema itself documents ref, within, selector and snapshot.

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?

Names a specific verb (press) and resource (key or chord) and gives concrete examples of accepted key syntax (Enter, Escape, Tab, ArrowDown, Control+a). It also states the target scope, an element or the page, so an agent can distinguish it from sibling input tools like browser_fill. It stops short of explicitly naming which sibling to use for other interaction types.

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: nothing says when keyboard presses are preferred over browser_click or browser_fill, and no prerequisites (such as focusing the target) are stated. The only implied guidance comes from 'on an element or the page', which tells the agent the target is optional but not when each mode is appropriate.

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