Skip to main content
Glama

press_key

Simulate keyboard input by sending a key or key combination to a page when fill() cannot handle keyboard shortcuts, navigation keys, or special key combinations.

Instructions

Press a key or key combination. Use this when other input methods like fill() cannot be used (e.g., keyboard shortcuts, navigation keys, or special key combinations). Note: On macOS, native elements cannot be operated with ArrowDown/Enter via press_key; use fill() on the combobox or click() on the option instead.

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": {
      "pageId": "<pageId>",
      "key": "<key>"
    },
    "name": "press_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesA key or a combination (e.g., "Enter", "Control+A", "Control++", "Control+Shift+R"). Modifiers: Control, Shift, Alt, Meta
pageIdYesTargets a specific page by ID.
includeSnapshotNoWhether to include a snapshot in the response. Default is false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

The single annotation readOnlyHint=false is weak on its own, and the description meaningfully extends it with a platform-specific behavioral limitation (macOS native <select> does not respond to ArrowDown/Enter). It does not discuss side effects such as Enter submitting a focused form, or whether the target must already have focus, which keeps it short of a 5.

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, purpose front-loaded, then the usage condition, then the platform caveat. Every sentence earns its place and nothing is repeated from the schema.

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 three-parameter interaction tool with no output schema and only a readOnlyHint annotation, the description covers the main risk of misuse (wrong tool for text entry, macOS select failure). It leaves implicit the focus requirement and the fact that Enter may trigger form submission, which would round it out for a tool that mutates page state.

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%, and the schema itself lists the modifier keys (Control, Shift, Alt, Meta) and combination examples, so the description adds no parameter meaning of its own. The baseline of 3 applies when the schema does the heavy lifting.

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 first sentence gives a specific verb and resource ("Press a key or key combination"), and the second immediately scopes it against other input methods by naming fill() as the preferred alternative. An agent can tell this apart from type_text, fill, or click without opening any 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 the positive trigger condition (keyboard shortcuts, navigation keys, special key combinations) and the negative one (when fill() cannot be used), and then names the concrete exception with the correct fallbacks: native <select> on macOS should use fill() on the combobox or click() on the option. This is explicit when/when-not/alternative guidance.

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