Skip to main content
Glama

Press a key or key combination

browser_press_key

Simulate real key presses in Firefox, including Ctrl/Shift/Alt/Meta modifiers, to trigger shortcuts, navigate pages, or repeat keys.

Instructions

Send a real key press, optionally with modifiers — Ctrl/Shift/Alt/Meta plus one key. Works for shortcuts (Ctrl+A, Ctrl+C, Ctrl+V, Ctrl+Z), navigation (Tab, Enter, Escape) and repeated keys. Uses BiDi input.performActions with the "key" action type, so pages see ordinary keydown/keyup events with the modifier flags set. Give keys in the WebDriver key vocabulary: Control, Shift, Alt, Meta, Enter, Tab, Escape, Backspace, Delete, ArrowUp/Down/Left/Right, Home, End, PageUp, PageDown, F1-F12, or a single character.

Input Schema

NameRequiredDescriptionDefault
keyYesThe key itself (e.g. "a", "Enter", "ArrowDown", "F5")
repeatNoPress this many times (default 1)
contextNoTab context id (default: the active tab)
modifiersNoModifier keys held during the press

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior5/5

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

Goes well beyond the lone readOnlyHint=false annotation: it discloses the underlying mechanism (BiDi input.performActions with the 'key' action type) and, importantly, that pages will observe ordinary keydown/keyup events with modifier flags set. That is exactly the kind of side-effect context an agent needs before firing keystrokes at a live page.

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 action and its modifier capability, then the use cases, then the format contract. The key-vocabulary enumeration is long but functional; little is wasted, though the BiDi sentence could be trimmed.

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?

With no output schema, the description needs to cover what happens on invocation, and it does through the keydown/keyup/BiDi disclosure. For a 4-parameter, single-required-field tool this is nearly sufficient; only tab-context behavior is left entirely to the schema.

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 supplying the full WebDriver key vocabulary and the rule that modifiers are 'plus one key', which lets an agent construct valid values without guessing. It does not describe the context or repeat parameters, but the schema's own descriptions are adequate there.

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?

Opening sentence gives a specific verb+resource ('Send a real key press, optionally with modifiers') and scopes what counts as a key. It implicitly distinguishes itself from siblings like browser_key_hold and browser_type through the press semantics, though neither is named explicitly.

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?

Concrete use cases are enumerated (shortcuts such as Ctrl+A/Ctrl+V, navigation keys, repeated presses), which gives an agent clear conditions for reaching for this tool. It stops short of stating when NOT to use it or naming browser_key_hold/browser_type as alternatives.

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

Deploy Server

Other Tools