Skip to main content
Glama

press_key

Dispatch a keyboard key press event on a page or targeted element. Use named keys like Enter or Escape for form submission, closing modals, or keyboard shortcuts. Returns updated page state.

Instructions

Dispatch a keyboard key press event on the page or a targeted element. Supports named keys (Enter, Escape, Tab, ArrowDown, Backspace) and character keys. Returns post-action page_state reflecting any DOM changes caused by the keypress. Use for form submission (Enter), closing modals (Escape), focus navigation (Tab), or keyboard shortcuts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesKey to press — use Playwright key names: "Enter", "Escape", "Tab", "ArrowDown", "ArrowUp", "Backspace", "Space", or single characters like "a". Modifier combos: "Control+a", "Shift+Tab".
widenNoWhen true, return the full-page diff instead of scoping to the interacted container. Default: false.
selectorNoOptional CSS selector or @eN ref to focus before pressing the key. If omitted, the key is dispatched to the currently focused element or the page.
Behavior4/5

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

Discloses that it returns post-action page_state reflecting DOM changes. Lacks details on error handling or permissions, but otherwise sufficient for a simple event dispatch 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?

Three well-structured sentences with front-loaded purpose. Every sentence adds value; no repetition or fluff.

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, but description explains return value. Covers all parameters and use cases adequately for a low-complexity tool.

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%, baseline 3. Description adds valuable context for all three parameters: key format, selector usage, and widen behavior.

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?

Clear verb 'Dispatch' with specific resource 'keyboard key press event on page or targeted element'. Lists supported keys and use cases, distinguishing from sibling tools like click or hover.

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?

Explicitly states use cases for form submission, closing modals, focus navigation, or keyboard shortcuts. Does not explicitly mention when not to use, but context is clear.

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/Mingye-Lu/AgenticCrawler'

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