Skip to main content
Glama

browser_press_key

Press a keyboard key or chord (for example Enter or Control+a) on a specified element or the focused element; for text input, use browser_type.

Instructions

Press a key or chord (Enter, Tab, Control+a); to a target, else the focused element. For text, browser_type.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "key": "<key>"
    },
    "name": "browser_press_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesKey name or chord (Enter, Control+a)
refNoref from browser_snapshot
textNoVisible text/label, instead of ref
stateNotrue: full page state
selectorNoCSS selector, instead of ref
snapshotNoSnapshot after the action

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.9.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / key / description
      Previous value: -"A key name or chord, e.g. Enter or Control+a"New value: +"Key name or chord (Enter, Control+a)"
    • changedInput schema / properties / ref / description
      Previous value: -"Element ref from browser_snapshot, e.g. 12"New value: +"ref from browser_snapshot"
    • changedInput schema / properties / selector / description
      Previous value: -"CSS selector (first match), instead of ref"New value: +"CSS selector, instead of ref"
    • changedInput schema / properties / snapshot / description
      Previous value: -"Also return the page snapshot after the action"New value: +"Snapshot after the action"
    • addedInput schema / properties / state
      Added value: +{
      +  "description": "true: full page state",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / text / description
      Previous value: -"Visible text or label of the element, instead of ref"New value: +"Visible text/label, instead of ref"
  2. First observedv0.7.1

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose one real behavioral trait: the key is dispatched to a target if given, otherwise to the currently focused element. It does not mention that keystrokes can trigger side effects such as form submission or navigation, nor what the boolean state/snapshot flags do to the response.

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?

Two telegraphic fragments with zero filler, and the primary action is front-loaded before the alternative. The phrasing 'to a target, else the focused element' is grammatically clipped, which slightly hurts readability but not interpretation.

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?

For a 6-parameter interaction tool with no annotations and no output schema, the definition covers the core action and targeting but leaves the semantics of the state and snapshot flags, and the possible consequences of a keypress, unexplained. Adequate to invoke correctly, thin on what to expect back.

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 baseline is 3. The description adds a little meaning for ref/selector by implying they are optional targeting mechanisms with a focus fallback, but it says nothing about state or snapshot beyond what the schema already states.

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 names a specific verb (press) and resource (key or chord), gives concrete examples (Enter, Tab, Control+a), and explicitly separates itself from the sibling it's most likely to be confused with by saying 'For text, browser_type.' An agent can pick this tool 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 Guidelines4/5

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

'For text, browser_type' gives an explicit alternative and the condition that selects it, and 'to a target, else the focused element' explains the default targeting path. There is no explicit when-not guidance beyond the text-input case, but the key routing decision is covered.

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