Skip to main content
Glama
xav-ie

Browser Session MCP

press_key

Destructive

Press a key in the active browser tab, optionally focusing a selector first, to trigger actions such as form submission.

Instructions

Press a key via CDP keyboard input in the session's active tab. key is a name (Enter, Tab, Escape, Backspace, ArrowDown, …) or a single character. With a selector, waits up to timeout for it and focuses it first (e.g. type into a field then press Enter); without, presses on whatever is focused, and timeout is unused. Use type for whole strings and click to activate buttons. Pressing Enter can submit a form, like a real user. Returns a confirmation. Fails on an unknown key name, or if the selector matches nothing within timeout.

Input Schema

NameRequiredDescriptionDefault
keyYesKey name in the US layout (Enter, Tab, Escape, Backspace, ArrowDown…) or one character.
timeoutNoMilliseconds to wait for `selector` to appear. Default 5000.
selectorNoCSS selector of an element to focus before pressing. Omit to press on the focused element.
sessionIdYesThe id returned by open_browser_session. Errors if no open session has it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / key / description
      Added value: +"Key name in the US layout (Enter, Tab, Escape, Backspace, ArrowDown…) or one character."
    • addedInput schema / properties / selector / description
      Added value: +"CSS selector of an element to focus before pressing. Omit to press on the focused element."
    • addedInput schema / properties / sessionId / description
      Added value: +"The id returned by open_browser_session. Errors if no open session has it."
    • addedInput schema / properties / timeout / description
      Added value: +"Milliseconds to wait for `selector` to appear. Default 5000."
  2. First observedv0.1.2

TDQS

A4.6/5.0
Behavior4/5

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

Adds real behavior beyond the annotations: focus acquisition, that `timeout` is unused without a selector, that Enter can submit a form 'like a real user', and explicit failure modes (unknown key name, selector never matching). The destructiveHint is implicitly supported by the form-submission warning, though it is not stated bluntly as a data-changing side effect.

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?

Front-loaded with the core action, then modes, then alternatives, then failure behavior — a sensible ordering with no filler. Slightly dense in the middle clause about selector/timeout, but each sentence carries information an agent needs.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers all four parameters, the two execution paths, the sibling alternatives, the notable side effect (form submission), the return signal ('a confirmation'), and the failure conditions. With no output schema, this is enough for an agent to call it correctly and anticipate outcomes.

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 100%, so the baseline is 3, but the description earns above baseline by explaining the interaction between `selector` and `timeout` (timeout is dead weight without a selector) and by giving a concrete use pattern ('type into a field then press Enter') that the schema does not convey.

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?

States a specific verb and mechanism ('Press a key via CDP keyboard input in the session's active tab') and immediately scopes it against siblings with 'Use type for whole strings and click to activate buttons.' An agent can distinguish press_key from type and click without opening any schema.

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?

Explicitly states the two operating modes: with a selector it waits and focuses first, without one it presses on whatever is focused. It also names alternatives (type, click) and the condition that selects them, leaving nothing to inference.

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