Skip to main content
Glama

Press keyboard key

browser_press_key

Dispatch key presses like Enter, Escape, Tab, or ArrowDown with optional Ctrl, Alt, Shift, or Meta modifiers to a focused or specified element. Use it to trigger shortcuts, forms, or navigation in Chrome.

Instructions

Dispatch a keyboard key press (Enter, Escape, Tab, ArrowDown, Backspace, etc.) with optional modifier keys to a target element or active 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": "browser_press_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
altNoHold Alt modifier.
keyYesKey name as in KeyboardEvent.key, e.g. 'Enter', 'Escape', 'ArrowDown', 'a'.
refNoOptional element ref to focus first.
ctrlNoHold Ctrl modifier.
metaNoHold Meta/Command modifier.
shiftNoHold Shift modifier.
tabIdNoControlled tab id.
selectorNoOptional CSS selector to focus first.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

The annotations already declare readOnlyHint=false, destructiveHint=false, and openWorldHint=true, so the agent knows this is a non-destructive but state-changing and open-world interaction. The description adds the useful detail that the press is dispatched to a target element when one is given, otherwise to the active element, but it does not disclose likely side effects such as form submission, navigation, or scroll triggered by the key.

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?

It is a single, tight sentence with the action front-loaded and the parenthetical key examples kept short. Nothing is redundant, though the phrasing 'to a target element or active element' is slightly compressed and could be clearer about fallback behavior.

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?

With 8 parameters (1 required), no output schema, and annotations covering the safety profile, the description covers the core action adequately. It leaves out practical details an agent would want, such as what happens when both ref and selector are supplied, and whether a response or error is returned when the key has no effect.

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 every parameter (key, modifiers, ref, selector, tabId) is already documented in the schema, which sets the baseline at 3. The description only restates the modifier and targeting ideas in prose, adding no syntax, format, or precedence detail beyond the schema.

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 ('Dispatch a keyboard key press') and enumerates representative key names plus optional modifiers, so an agent knows exactly what action is performed. It does not explicitly contrast itself with the sibling text-entry tool (browser_type) or browser_click, so sibling differentiation is only implicit.

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?

Usage context is implied by the mention of 'target element or active element' and example keys like Enter and Tab, which suggests form submission and focus navigation. However, there is no explicit when-to-use versus browser_type, browser_click, or browser_select_option, and no stated exclusions or prerequisites.

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