Skip to main content
Glama

browser_press_key

Press keyboard keys on web pages to submit forms, close modals, navigate menus, or trigger shortcuts using standard key values and modifiers.

Instructions

[Disabled] Press a keyboard key on the page. Dispatches trusted (isTrusted: true) keyboard events via Chrome DevTools Protocol Input.dispatchKeyEvent. Named keys (Enter, Escape, etc.) dispatch rawKeyDown + keyUp; printable characters dispatch keyDown + char + keyUp. Common use cases: Enter to submit forms, Escape to close modals/dialogs, Tab to move between fields, arrow keys to navigate custom menus/dropdowns, Ctrl+K or Cmd+K for search. Supports Ctrl and Meta (Cmd) as independent modifiers. Uses standard KeyboardEvent.key values.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabIdYesTab ID of the page to interact with
keyYesKey name using standard KeyboardEvent.key values (e.g., "Enter", "Escape", "Tab", "ArrowDown", "a", "1", " ")
selectorNoCSS selector of element to focus before pressing key. If omitted, dispatches to document.activeElement.
modifiersNoModifier keys to hold while pressing the key
Behavior4/5

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

With no annotations provided, the description carries full burden and delivers substantial value: it discloses the use of Chrome DevTools Protocol Input.dispatchKeyEvent, the trusted event status (isTrusted: true), and the specific event sequences dispatched (rawKeyDown+keyUp for named keys vs keyDown+char+keyUp for printable characters). Missing only error handling behavior and return value details.

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?

Six sentences that are information-dense and well-structured: opens with status and purpose, follows with technical mechanism, event dispatch details, use cases, and modifier support. Every sentence earns its place by conveying unique technical information not present in structured fields. Slightly dense but appropriate for the complexity.

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?

Given no output schema and no annotations, the description comprehensively covers the input mechanics, event dispatching behavior, and practical use cases. However, it omits documentation of return values, success/failure indicators, or behavior when the specified tabId or selector is invalid, which would complete the operational contract.

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?

Input schema has 100% description coverage, establishing baseline 3. The description adds context by referencing 'standard KeyboardEvent.key values' for the key parameter and noting that Ctrl and Meta are 'independent modifiers,' but does not expand significantly beyond the schema's own documentation for tabId, selector, or the modifiers object structure.

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 explicitly states the tool 'Press a keyboard key on the page' and distinguishes itself from siblings like browser_type_text and browser_click_element by specifying it dispatches keyboard events (not mouse events or text input) via Chrome DevTools Protocol. The '[Disabled]' prefix clearly signals availability status without obscuring the purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit common use cases (Enter for forms, Escape for modals, Tab for fields, arrow keys for navigation, Ctrl+K for search) that clearly indicate when to use this tool. However, it lacks explicit guidance on when to use browser_type_text instead for string input, or error conditions that would prevent use.

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/opentabs-dev/opentabs'

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