Skip to main content
Glama

press_key

Press keys or shortcuts like Enter, Escape, Tab, or Ctrl+K in a browser, with optional element focusing via ref or CSS selector for precise input.

Instructions

Press a key or shortcut (Enter, Escape, Tab, arrows, Ctrl+K). Optionally focus an element first via ref or selector.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesKey to press, e.g. 'Enter'; printable chars as-is
refNoElement ref to focus first
selectorNoCSS selector to focus first
modifiersNoModifier keys held during the press

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed6 schema fields changedv2.10.5
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / key / description
      Previous value: -"Key to press — e.g. 'Enter', 'Escape', 'Tab', 'a', 'ArrowDown', 'F1'. For printable characters use the character itself."New value: +"Key to press, e.g. 'Enter'; printable chars as-is"
    • changedInput schema / properties / modifiers / description
      Previous value: -"Modifier keys to hold during key press (e.g. ['ctrl', 'shift'] for Ctrl+Shift+key)"New value: +"Modifier keys held during the press"
    • changedInput schema / properties / ref / description
      Previous value: -"Element ref to focus before pressing key (e.g. 'e5')"New value: +"Element ref to focus first"
    • changedInput schema / properties / selector / description
      Previous value: -"CSS selector to focus before pressing key (e.g. '#search-input')"New value: +"CSS selector to focus first"
  2. First observedv2.7.0

TDQS

A3.8/5.0
Behavior3/5

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

There are no annotations, so the description carries the burden of behavioral disclosure. It states the core action (pressing a key or shortcut) and the optional focus-first behavior, which is useful. It does not disclose details like whether the key event is dispatched natively, whether modifiers are held during the press, or whether any wait/retry behavior occurs, but the description is not misleading.

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 a single, tightly worded sentence that front-loads the core action and then adds the optional focusing detail. No filler or redundant information is present.

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?

For a relatively simple keyboard-action tool with a fully described schema, the description covers the essential usage and behavior. It lacks an explicit note about return values or post-press page effects, but the tool's low complexity and complete parameter documentation make the definition largely sufficient.

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 key, ref, selector, and modifiers. The description adds value with concrete key examples and clarifies the optional focus-first usage of ref/selector, but it does not meaningfully enrich parameter semantics beyond what the schema provides.

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 uses a specific verb ('Press') and a clear resource ('a key or shortcut'), with concrete examples like Enter, Escape, Tab, arrows, and Ctrl+K. This makes the tool's purpose unambiguous and distinguishes it from sibling tools like click (mouse action) or type (text input) without needing to open 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 Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use the tool through examples of keyboard shortcuts and key presses, and mentions the optional focus-first behavior via ref or selector. However, it does not explicitly state when to prefer press_key over siblings like type or click, nor does it provide exclusions or alternative routing.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Silbercue/public-browser'

If you have feedback or need assistance with the MCP directory API, please join our Discord server