Skip to main content
Glama

press_key

Sends a real key press or combo to the focused element so you can submit forms with Enter, close dialogs with Escape, move with Tab, or run shortcuts like Control+c.

Instructions

Send a real key press (or combination) to whatever element currently has focus: submit with Enter, close dialogs with Escape, move with Tab or the arrow keys, or use shortcuts such as Control+a, Control+c, Control+v. Focus first with click or type if needed. To enter text use type instead; to set form fields use fill_form. Returns the key and repeat count; page changes are not reported, so snapshot afterwards. An unrecognised key name returns an error.

Input Schema

NameRequiredDescriptionDefault
tabNoTab id from tabs_list. Defaults to the current tab.
keysYesOne key or a '+'-joined combo, e.g. Enter, Escape, Tab, ArrowDown, PageDown, a, Control+a, Meta+Shift+k. Modifiers: Control, Shift, Alt, Meta.
repeatNoTimes to press the key (default 1).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.2
    • changedInput schema / properties / keys / description
      Previous value: -"Key or combo; modifiers: Control, Shift, Alt, Meta."New value: +"One key or a '+'-joined combo, e.g. Enter, Escape, Tab, ArrowDown, PageDown, a, Control+a, Meta+Shift+k. Modifiers: Control, Shift, Alt, Meta."
    • changedInput schema / properties / repeat / description
      Previous value: -"Times to press (default 1)."New value: +"Times to press the key (default 1)."
  2. First observedv0.1.1

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations, the description discloses that this sends a real key press to the focused element, that page changes are not reported and a snapshot should follow, that it returns the key and repeat count, and that an unrecognised key name returns an error. These are useful operational details for a non-read-only, open-world browser action.

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?

The description is front-loaded with the core action, then gives examples, focus guidance, alternative tools, return behavior, and error behavior in a compact sequence. Every sentence contributes useful selection or invocation information without repetition.

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?

There is no output schema, but the description covers return behavior (key and repeat count), side-effect visibility (page changes not reported; snapshot afterwards), error behavior, and the focus prerequisite. Combined with the fully documented schema and annotations, an agent has enough to call the tool correctly.

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 schema already documents keys, repeat, and tab. The description reinforces that keys can be combos and clarifies the focus context, but it does not add substantial parameter-level meaning beyond the schema, so the baseline 3 is appropriate.

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 opens with a specific verb and resource: "Send a real key press (or combination) to whatever element currently has focus." It gives concrete examples and explicitly distinguishes the tool from siblings type and fill_form, so an agent can identify its role without opening the schema.

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?

It states when to use the tool (Enter to submit, Escape to close dialogs, Tab/arrows to move, shortcuts like Control+a) and names alternatives for adjacent tasks: "To enter text use type instead; to set form fields use fill_form." It also explains the prerequisite to focus first with click or type.

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