Skip to main content
Glama

Press key

press_key

Presses a key or chord to trigger shortcuts, form submissions, or navigation in a Chromium page, optionally focusing a selector first and waiting for resulting navigation.

Instructions

Press a key or chord, e.g. "Enter", "Tab", "Escape", "ArrowDown", "Control+A". Focuses the element first when a selector is given, otherwise sends it to whatever has focus. Waits for any navigation it triggers.

Input Schema

NameRequiredDescriptionDefault
keyYesKey name as used by Playwright keyboard.press
frameNoCSS selector of the iframe containing the element (e.g. "iframe[name^=__privateStripeFrame]"), or a list for nested iframes, outermost first. Not needed with aria-ref selectors.
timeoutNoTimeout in milliseconds
selectorNoSelector: "aria-ref=e5" from get_page_snapshot (preferred; also reaches into iframes), CSS ("#email", "button.submit"), text ("text=Sign in"), role ("role=button[name=/save/i]") or XPath ("xpath=//a")

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With only readOnlyHint=false and openWorldHint=true in annotations, the description adds useful behavioral detail: it focuses the target element when a selector is provided, otherwise sends the key to whatever has focus, and waits for any navigation triggered. It does not describe timeout/error behavior, but it meaningfully extends beyond the annotations.

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 compact and front-loaded: the primary action and examples come first, followed by conditional focus behavior and navigation waiting. Every sentence contributes useful information with no repetition or 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 four-parameter mutation tool with full schema coverage, no output schema, and annotations covering safety/open-world behavior, the description is nearly complete. It covers key/chord examples, focus semantics, and navigation waiting; minor gaps like timeout failure behavior are acceptable given the schema documents timeout.

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 already 100%, so the baseline is 3. The description earns extra credit by clarifying chord syntax via examples and by explaining the selector parameter's focus semantics, which are not fully captured in the schema text alone.

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?

Starts with a specific verb and resource ("Press a key or chord") and immediately supplies concrete examples, including modifier chords like "Control+A". This distinguishes it cleanly from sibling tools such as click_element and fill_input.

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 explains the selector/no-selector behavior, which implies when to use each mode, but it never explicitly contrasts this tool with alternatives like click_element, fill_input, or wait_for. Usage context exists but is not framed as when-to-use guidance.

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