Skip to main content
Glama

press_key

Simulate pressing a key on the currently focused element in the browser, such as Enter to submit or Tab to move focus. Use it for keyboard interactions after focusing an element.

Instructions

Press one key on whichever element currently has focus, e.g. Enter to submit, Tab to move focus, Escape to close a dialog, or arrow keys in a list. Named keys: enter, tab, escape/esc, backspace, delete, space, arrowup, arrowdown, arrowleft, arrowright, home, end, pageup, pagedown; any other value is typed as literal text. To type into a specific field, use type, which focuses the field first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesKey name (case-insensitive), e.g. 'Enter', 'Tab', 'Escape', 'ArrowDown', or a single character.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.0
    • addedInput schema / properties / key / description
      Added value: +"Key name (case-insensitive), e.g. 'Enter', 'Tab', 'Escape', 'ArrowDown', or a single character."
  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?

With no annotations, the description carries the full burden and does well: it discloses that the key is delivered to the focused element rather than a addressed target, enumerates the recognized named keys, and reveals the important fallback that any other value is typed as literal text. It does not state what happens when nothing is focused or how failures surface, which is the remaining gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, all earning their place, with the core behavior front-loaded and the sibling routing placed last where it aids selection. No filler or restatement of the title.

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?

No output schema exists and none is implied for a keystroke action, so return-value explanation is unnecessary. The accepted key vocabulary and literal-text fallback are covered; only edge behavior (no focused element, unsupported keys, focus loss) is left unstated.

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 baseline is 3, but the description adds real meaning beyond the schema: it enumerates the accepted named-key set and, crucially, defines the behavior of values outside that set (typed as literal text). That is semantics the schema's single 'key' string field 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 (press) and resource (one key) plus the crucial scope restriction: it acts on whatever currently has focus, not a selector-addressed target. This cleanly distinguishes it from the sibling 'type', which focuses a field first.

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?

Gives concrete usage scenarios (Enter to submit, Tab to move focus, Escape to close a dialog, arrows in a list) and explicitly names the alternative tool plus the condition selecting it: 'To type into a specific field, use type, which focuses the field first.' No inference required.

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