Skip to main content
Glama

Press a key

qa_press

Dispatch keyboard keys such as Enter, Escape, and Tab to focused elements or selectors, then return page changes, actual focus, and live-region announcements for reliable browser automation.

Instructions

Dispatch a keyboard key (keydown/keypress/keyup) — Enter to submit, Escape to close, Tab to move focus. Without a selector it goes to whatever currently has focus, like a real keyboard. Like qa_click, it returns what changed once the page settled. On a recent extension build the reply also carries focus — the element that ACTUALLY holds focus after the key (name, role, selector, box), which is how you follow a Tab route or catch focus landing somewhere unnamed — and announced, what the live regions spoke (null = they stayed silent). Requires the one-time “Agent control” confirmation in the panel; without it the extension answers consent-required and does nothing.

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": "qa_press"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesKey value, e.g. "Enter", "Escape", "Tab", "a"
refNoOptional target (a qa_snapshot ref); defaults to the focused element
tabIdNoTarget tab (from qa_tabs); omit for the active tab
frameIdNoWhich frame to ask, from qa_frames. Omit for the page itself. A payment form, an SSO step or an embedded widget usually lives in a frame of its own, and a cross-origin one can only be read from inside it.
selectorNoOptional target (CSS); defaults to the focused element

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.86.2

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: it discloses the focus-following default, that the call waits for the page to settle and reports what changed, the shape of the reply (`focus` with name/role/selector/box, and `announced` where null means silent), and the consent gate that blocks execution. It also communicates side effects (Enter submits, Escape closes) that an agent needs before pressing keys.

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?

One front-loaded paragraph that opens with the action, then defaults, then return shape, then the consent caveat — a sensible order. It is dense with real information, though the long parenthetical about `focus`/`announced` and the hedge 'On a recent extension build' could be tightened without losing content.

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?

Since no output schema exists, the description must cover return values, and it does — 'what changed', the `focus` record, and `announced`. Combined with the consent prerequisite and default targeting, an agent has enough to call it correctly; only the exact shape of 'what changed' is left implicit by reference to qa_click.

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 `key`, `ref`, `selector`, `tabId` and `frameId` are already documented in the schema, including the focused-element default. The description reinforces that default but adds no new syntax, precedence rules (ref vs selector vs both) or frame guidance beyond what the schema states, so baseline 3 applies.

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 resource — dispatch a keyboard key, with keydown/keypress/keyup spelled out — and gives concrete key examples (Enter to submit, Escape to close, Tab to move focus). It also positions itself relative to a sibling by noting 'Like qa_click, it returns what changed', so an agent can separate key dispatch from pointer dispatch.

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?

Explains the default targeting rule clearly ('without a selector it goes to whatever currently has focus') and surfaces a hard prerequisite: the one-time 'Agent control' confirmation, without which it returns consent-required and does nothing. It gives intent examples for Enter/Escape/Tab, but never names an alternative to choose instead (e.g. qa_click for buttons), so it stops short of explicit when-not-to-use guidance.

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