Skip to main content
Glama

browser_press_key

Press a key or chord as real keyboard events on a targeted or focused element, enabling form submission, tab navigation, shortcuts, and other keyboard interactions in browser automation.

Instructions

Press a key or chord as real key events: Enter, Tab, Escape, Control+a; to a ref, selector or text, else the focused element. For text, browser_type.

Input Schema

NameRequiredDescriptionDefault
keyYesA key name or chord, e.g. Enter or Control+a
refNoElement ref from browser_snapshot, e.g. 12
textNoVisible text or label of the element, instead of ref
selectorNoCSS selector (first match), instead of ref
snapshotNoAlso return the page snapshot after the action

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and openWorldHint=true, so the mutation and external-page profile is covered. Beyond that, the description adds genuine behavior: keys are dispatched 'as real key events' rather than synthesized values, and it defines the fallback to the currently focused element when no target is given — a trait not present in the annotations or schema.

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 compact sentences with the core action and examples front-loaded, and the alternative tool named last. The phrasing is telegraphic and slightly clipped ('to a ref, selector or text, else the focused element'), but every clause carries information and there is no filler.

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?

For a five-parameter input tool with full schema coverage, existing annotations, and no output schema, the description covers the key format, the target-selection strategy, and the alternative tool for text. Nothing an agent needs in order to invoke this correctly appears to be missing.

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 coverage is 100%, so the baseline is already 3; each parameter carries its own description in the schema. The description adds marginal value by clarifying that 'key' accepts chords and by implying a target precedence, but it does not give chord syntax rules or say what the boolean 'snapshot' flag returns, beyond what the schema 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?

States a specific verb plus resource ('Press a key or chord as real key events') and gives concrete example keys (Enter, Tab, Escape, Control+a), so the agent immediately knows this is keyboard input rather than text entry or clicking. It is clearly separable from the sibling browser_type via the explicit hand-off sentence.

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?

Explicitly routes text entry to browser_type ('For text, browser_type.') and specifies the target-resolution order (ref, selector, text, else the focused element). It stops short of stating when pressing keys is inappropriate or what happens when no element is focused, so it is clear context rather than full when/when-not guidance.

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