Skip to main content
Glama

browser_press_key

Presses keyboard keys at the current focus to close dialogs, tab between fields, select suggestions, undo edits, or move the caret before typing text; not for entering text.

Instructions

Press keys, in order, where focus is: Escape closes a dialog on the page, Tab moves to the next field, ArrowDown/Enter pick from a suggestion list, End or arrows move the caret before browser_input_text without emsn types there, Control+Z undoes. Not for typing text. Refused, nothing pressed: copy/cut/paste, and the browser's own shortcuts (use browser_close_tab, browser_reload and so on). Replies once the page has handled the last key; it does not say what the keys did, so snapshot to see. A list highlighted under the pointer counts arrows from that item, which a snapshot does not show: to pick a given item, click it.

Input Schema

NameRequiredDescriptionDefault
emsnNoFocus this element first: clicked unless focus is already in it, so a button or link acts and a field's caret moves to the click. Leave out to press where focus is.
keysYesAt most 100 presses in all.
tabIdNoTab to act on. Defaults to the foreground tab of that window.
windowIdNoWindow to act on. Defaults to the frontmost window.
snapshotIdYesThe snapshotId from the browser_take_snapshot you picked the emsn out of. An element keeps its emsn while the page stays (no navigation or reload), so with an emsn any snapshot of the current page is accepted; with x,y only the latest one is. A number whose element has gone is refused rather than clicked.
repeatDelayMsNoPause between presses, default 80.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and largely succeeds: it discloses that refused key sequences result in nothing being pressed, that the call returns a reply only after the page handles the last key, and crucially that it does not report what the keys did — so a snapshot is needed. It also explains the arrow-from-highlighted-item gotcha that snapshots don't show. It does not mention focus requirements beyond 'where focus is' or error behavior for stale emsns (left to schema).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded with the core behavior, but the single sprawling sentence front-loads examples before stating the purpose plainly, and the 'before browser_input_text without emsn types there' clause is garbled and hard to parse. Information is useful but structurally crowded.

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 6-parameter interaction tool with no annotations and no output schema, the description covers the key behavioral risks: refused shortcuts, asynchronous completion, absent feedback requiring a snapshot, and the highlighted-item arrow caveat. The one gap is the lack of explicit mention of what is returned on refusal or how emsn staleness surfaces, though the schema covers emsn.

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 the schema already documents emsn, keys, repeatCount, tabId, windowId, and repeatDelayMs thoroughly. The description adds only a little beyond that — the ordering semantics ('in order') and the pointer-highlight interaction with arrows. Baseline 3 fits when the schema does the heavy lifting.

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 states a specific verb and resource — pressing keys in order at the current focus — and immediately distinguishes itself from browser_input_text ('Not for typing text'). The concrete examples (Escape, Tab, ArrowDown/Enter, Control+Z) make the intended use unmistakable, though the opening sentence is dense and the 'emsn' typo-ish phrasing slightly obscures the caret relationship.

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

Usage Guidelines5/5

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

It gives explicit positive cases (close a dialog, move between fields, pick from a suggestion list), explicit exclusions (copy/cut/paste and browser shortcuts, routed to browser_close_tab/browser_reload), and a named alternative for text entry (browser_input_text). An agent knows exactly when to call this and when to call something else.

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