Skip to main content
Glama
electron-stagewright

Electron Stagewright

Press a key or chord

electron_key

Press a key or chord (e.g., 'Enter', 'Control+A') on an element specified by CSS selector or accessibility ref, with optional force to bypass actionability checks.

Instructions

Press a key or chord (e.g. 'Enter', 'Control+A', 'ArrowDown'). Focuses ref/selector first when given; otherwise presses against the active element. For editors, click the visible content area first; reserve force:true for offscreen inputs that truly accept focus. Options: force, timeoutMs. Returns: { ok, session_id, key }. Errors: SELECTOR_NO_MATCH / REF_NOT_FOUND (carries similar_refs), ELEMENT_NOT_VISIBLE (retryable), NOT_RUNNING, BAD_ARGUMENT (ref+selector both).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesKey or chord, e.g. 'Enter' or 'Control+A'.
refNoElement ref from a snapshot (resolves to [data-sw-ref="N"]). Provide ref OR selector.
forceNoBypass actionability checks (visibility/enabled/stable). Default false.
selectorNoCSS selector. Provide ref OR selector, not both.
sessionIdNoTarget session id. Omit when a single session is running.
timeoutMsNoActionability budget in ms (default 5000, clamped to 30000).
Behavior4/5

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

Annotations indicate readOnlyHint=false, confirming mutation. The description adds valuable behavioral details: focus behavior, force usage, error types (including retryable ELEMENT_NOT_VISIBLE), and return values. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single dense paragraph that efficiently covers purpose, behavior, exceptions, and return values. It is front-loaded with the core action. Minor redundancy (e.g., repeating 'ref/selector') but overall concise.

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 complexity (6 parameters, mutating action, multiple error types), the description covers all essential aspects: focus behavior, force guidelines, timeout, error conditions, and return format. Without an output schema, the return description suffices. Some details like sessionId are implicit but clear.

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%, so each parameter has a description. The tool description adds context beyond the schema, such as the focusing logic for ref/selector and when to use force. The key parameter examples enhance understanding.

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 explicitly states 'Press a key or chord' and provides concrete examples ('Enter', 'Control+A', 'ArrowDown'). It clearly distinguishes this tool from siblings like electron_keyboard_type (which types strings) and electron_press_sequence (which presses multiple keys), making the purpose unambiguous.

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?

The description provides explicit when-to-use guidance: 'Focuses ref/selector first when given; otherwise presses against the active element.' It advises for editors to 'click the visible content area first' and warns to 'reserve force:true for offscreen inputs that truly accept focus.' This helps the agent decide between this tool and 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/electron-stagewright/electron-stagewright'

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