Skip to main content
Glama

browser_press

Sends key presses or modifier chords to a specified browser tab or element, enabling keyboard shortcuts and DOM-based input while keeping browser operations in the background.

Instructions

Press a key or chord such as ctrl+a, Return or shift+Left. Uses DOM editing in both browsers to preserve background operation. Trusted keyboard input is unsupported.

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": {
      "tabId": "<tabId>",
      "key": "<key>"
    },
    "name": "browser_press"
  }
}

Input Schema

NameRequiredDescriptionDefault
altNo
keyYes
refNoElement ref from the latest snapshot in this document.
ctrlNo
metaNo
shiftNo
tabIdYesTab id from browser_tabs.
expectNoPost-action condition. Default timeout is 1.2 seconds in visible pages and 3 seconds in hidden pages. A mismatch does not undo the action; inspect before retrying.
browserNoBrowser id from browser_list, or chrome/firefox when only one instance matches.
frameIdNoFrame id from browser_frames; defaults to top frame.
revisionNoReject if the DOM revision differs from the snapshot.
selectorNoCSS selector. Must identify exactly one element.
inputModeNoAuto uses trusted Chrome text insertion only in the active foreground tab; DOM otherwise. Pointer actions and keys always use DOM.auto
documentIdNoReject the action if this snapshot document has changed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose real behavior: both engines use DOM editing so background operation is preserved, and trusted input is unavailable. It omits other consequential traits such as whether the key is delivered to a focused element or to the target identified by ref/selector, and that the tool mutates page state.

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?

Three short sentences, front-loaded with the core action and examples, then the operational constraint. Every sentence adds information and there is no filler.

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?

For a 14-parameter tool with no annotations and no output schema, the description covers the core action and the DOM/trusted limitation but leaves important context unstated, such as how the target element is chosen and where keystrokes land. The detailed schema compensates for much of the parameter surface, keeping this adequate rather than deficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 64%, so the baseline is 3, but the description adds genuine value: the required `key` parameter has no schema description, and the examples clarify chord syntax and modifier handling that the schema never spells out. It does not cover tab targeting, the expect semantics, or revision guarding beyond what the schema already says.

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 specific verb and resource (press a key or chord) and concrete examples (ctrl+a, Return, shift+Left) that make the keyboard-input nature unmistakable. That distinguishes it from mouse-oriented siblings such as browser_click, browser_hover, and browser_move without ambiguity.

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?

It states usage is DOM-based in both browsers and notes trusted keyboard input is unsupported, which is useful context. Nothing is stated about when to prefer this over browser_fill, browser_paste, or browser_select_text, and no prerequisites such as focus are given, so the guidance is only implied.

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