Skip to main content
Glama

Press key

press_key

Simulate hardware key presses in a React Native app: navigate back, return home, or submit a text field via its onSubmitEditing handler without needing the OS keyboard.

Instructions

Press a hardware key. "back" goes up one screen — via "js" (tried first by default) calls the navigation container's own goBack() with no touch, via "os" uses the hardware key (Android) or an edge swipe (iOS). "home" is OS-only. "enter" submits a text field by firing its own onSubmitEditing, the only route to a submit handler that does not need the OS keyboard — pass into to name the field when more than one is on screen and none holds focus.

Input Schema

NameRequiredDescriptionDefault
keyYes
viaNo
intoNo
deviceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that 'js' bypasses the OS entirely by invoking the navigation container's goBack(), that 'os' degrades to a hardware key or edge swipe depending on platform, and that 'enter' fires onSubmitEditing without the OS keyboard. It omits failure behavior (e.g., what happens if no navigation container exists) and the role of the `device` parameter.

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 core action is front-loaded and every clause about back/home/enter earns its place by disambiguating behavior. The prose is dense with parenthetical asides and em-dashes, which slightly impedes scanning but does not waste words.

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 tool with no annotations, no output schema, and a nested object parameter, the description supplies most of what an agent needs: key semantics, strategy selection, and field targeting. The remaining gaps are the undocumented `device` parameter and the absence of any statement about return values or error cases.

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 description coverage is 0%, so the description must compensate, and it does for three of four parameters: it defines the semantics of each `key` value, the two `via` strategies plus the implicit default, and what `into` matches (label/testID/placeholder) when multiple fields are present. The `device` parameter is completely undiscussed, and the 'auto' enum value is never named.

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?

States a specific verb and resource ('Press a hardware key') and then enumerates the three supported keys with their distinct behaviors. This is clearly distinguishable from siblings like tap, swipe, or navigate, which perform touch/gesture or route-level actions.

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 guides the choice of `via`: 'js' is tried first by default and calls goBack() without touch, 'os' uses the hardware key or an edge swipe, and 'home' is OS-only. It also explains when to pass `into` for 'enter'. It stops short of telling the agent when to prefer this tool over navigate or tap in a navigation flow.

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