Skip to main content
Glama

press_key

Simulate keyboard key presses or shortcuts like Enter, Escape, Tab, or Ctrl+K. Optionally focus an element using a CSS selector or ref before pressing the key.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesKey to press — e.g. 'Enter', 'Escape', 'Tab', 'a', 'ArrowDown', 'F1'. For printable characters use the character itself.
refNoElement ref to focus before pressing key (e.g. 'e5')
selectorNoCSS selector to focus before pressing key (e.g. '#search-input')
modifiersNoModifier keys to hold during key press (e.g. ['ctrl', 'shift'] for Ctrl+Shift+key)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals an important behavior: it can optionally focus an element via ref or selector before pressing the key. This is clear and sufficient for a simple keyboard press tool.

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 extremely concise: two sentences covering the action, optional focus, and typical uses. Every word contributes meaning, with no fluff or repetition.

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?

Given the tool's simplicity and lack of output schema, the description covers all necessary aspects: the key press action, optional focusing, and example keys/shortcuts. It could mention that pressing a key may trigger page events, but overall it is adequate.

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?

The schema has 100% description coverage with detailed explanations for each parameter. The description adds only the phrase about optional focus, which is already present in the schema for 'ref' and 'selector'. Thus, it provides minimal additional value over the schema.

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 clearly states the action (press a key) and the resource (keyboard). It distinguishes from siblings like 'click' and 'type' by specifying keys, shortcuts, and optional element focus. Examples like 'Enter', 'Escape', and 'Ctrl+K' make the purpose immediately understandable.

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?

The description gives specific use cases ('Enter, Escape, Tab, arrows, shortcuts (Ctrl+K)'), which guides the agent on when to use this tool. It implies the tool is for individual key presses or shortcuts, not for typing text (use 'type') or clicking (use 'click'), but does not explicitly state exclusions or alternatives.

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

Install Server

Other Tools

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