Skip to main content
Glama
agent-browser-mcp

agent-browser-mcp

by zy2755

browser_press_key

Simulate keyboard key presses such as Enter, Tab, ArrowDown, or Control+a in the browser; optionally focus a referenced element before pressing.

Instructions

按下键盘按键,如 Enter / Tab / ArrowDown / "Control+a"。带 ref 时先聚焦该元素。

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键名,如 Enter、Escape、ArrowDown、Control+a
refNo先聚焦此元素再按键

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full burden, yet it does not say whether the key is dispatched to the currently focused element or page-level, whether modifier combos like "Control+a" are supported beyond the one example, whether it waits for the action, or what happens if ref points to a non-focusable element.

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?

Two short sentences, front-loaded with the core action and examples, with no filler. The second clause duplicates the ref parameter description from the schema, which is the only mildly redundant part.

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 simple two-parameter tool with full schema coverage and no output schema, the basic contract is covered. It stops short of describing focus target defaults or failure behavior, which matter for a keyboard-interaction tool in a browser automation loop.

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 both parameters are already documented in the schema. The description only restates the schema's examples (Enter/Tab/ArrowDown/Control+a) and the ref pre-focus behavior, adding no new syntax or format semantics.

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 concrete verb+resource ("按下键盘按键" / press a keyboard key) and gives example keys, so the action is unambiguous. It does not distinguish itself from siblings such as browser_type, which is the closest source of confusion for an agent choosing a tool.

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?

No when-to-use or when-not-to-use guidance: nothing says to prefer this over browser_type for text entry or over browser_select_option for dropdowns. The only conditional information ("带 ref 时先聚焦该元素") describes a parameter effect rather than routing guidance.

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