Skip to main content
Glama

按键

browser_press_key
Destructive

Simulates pressing a key or key combination such as Enter, Tab, or Ctrl+C on the focused element in a browser tab, optionally with Ctrl, Alt, Shift, or Meta modifiers, enabling keyboard shortcuts and form submission.

Instructions

Press a key on the focused element, optionally with Ctrl/Alt/Shift/Meta modifiers. Supports Enter, Escape, Tab, Backspace, Delete, ArrowUp/Down/Left/Right, PageUp/PageDown, Home/End, F1-F12, a single character, or common combinations such as Ctrl+C and Ctrl+Shift+R.

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 combination, e.g. "Enter", "Escape", "Ctrl+C", "Ctrl+Shift+R"
tabIdNoTab id (default: active tab)
modifiersNoOptional modifier keys; equivalent to including them in key with +.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.15.0

TDQS

A3.7/5.0
Behavior3/5

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

The annotations already disclose that the operation is non-read-only, non-idempotent, destructive, and open-world. The description adds useful focus dependence and examples of potentially consequential shortcuts, but it does not explain resulting side effects, failure behavior when nothing is focused, or whether browser-level shortcuts can trigger navigation or other external changes.

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 two sentences are front-loaded with the action and target, followed by a compact but informative list of supported inputs. The key list is somewhat long, but every item helps define the tool's accepted input space and there is no filler.

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

Completeness4/5

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

For a simple three-parameter keyboard tool with a fully documented schema, the description supplies enough information to construct most calls correctly. Its main remaining gaps are practical guidance about focusing an element first and clarification of side effects or failure behavior, especially for browser-level shortcuts.

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 100%, so the baseline is 3, but the description adds substantial accepted-value detail by enumerating navigation, editing, function, and single-character keys. It also reinforces modifier combinations, while tab targeting and the equivalence of the modifiers parameter remain adequately documented in 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 clearly states the action, resource, and target: pressing a keyboard key on the focused element, with optional modifiers. It does not explicitly distinguish the tool from siblings such as browser_click or browser_fill_form.

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?

The focused-element wording implies that this is for keyboard interaction with an already focused target. However, it does not explain when keyboard input is preferable to clicking or form filling, nor does it explicitly state how to establish focus or when not to use the tool.

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