Skip to main content
Glama

Press a key

browser_press_key

Send keyboard key presses to a page or focused element, using Playwright key names or chords like Control+A. Optionally focus a specific element first to simulate user input.

Instructions

Send a keyboard key to the page or to a focused element. Accepts Playwright key names: Enter, Tab, Escape, ArrowDown, PageDown, Backspace, or chords like Control+A.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYese.g. 'Enter', 'Escape', 'Control+A'.
repeatNo
targetNoFocus this element first.
tabIndexNoAct on this tab just for this call, without changing which tab is active. Defaults to the active tab. To switch tabs for good, use browser_tabs with action 'select'.
profileIdYesBrowser profile id, as passed to start_profile.
Behavior3/5

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

The description adds some context by explaining the key types and the ability to target an element, but does not disclose potential side effects like form submission or focus changes beyond the annotation hints. The annotations indicate non-read-only and non-destructive, which the description does not contradict, but it provides only marginal transparency.

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 description is two sentences, immediately states the action, and provides relevant key examples without irrelevant information. It is appropriately sized and front-loaded.

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?

Given the complex schema with nested target object and annotations, the description is sufficient to convey the core action, but it lacks details on return values, error handling, and edge cases like invalid keys or missing targets. The schema covers parameter semantics but not behavioral outcomes.

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?

The description supplements the schema with additional Playwright key examples (ArrowDown, PageDown, Backspace) and notes that keys can be sent to the page or focused element, which aligns with the target parameter. However, the schema already covers key details and target descriptions, so the added value is limited.

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 description clearly states 'Send a keyboard key to the page or to a focused element', identifying the specific verb and resource. It also lists Playwright key names, which distinguishes it from sibling tools like browser_type (typing text) and browser_click (mouse click).

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 description implies usage for keyboard actions but does not explicitly state when to use this tool over alternatives like browser_type or browser_click. There is no when/when-not guidance, only the action description itself.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/someorgyouwontcareabout/DolphinMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server