Skip to main content
Glama

Press keys

press_key

Sends a key or key combination to the focused element to trigger actions like Enter, Escape, or Control+A; supports repeat counts and a target tab.

Instructions

Presses a key or key combination on the focused element, e.g. "Enter", "Escape", "Control+A", "Shift+Tab", "ArrowDown".

Input Schema

NameRequiredDescriptionDefault
keysYesKey or combination joined with "+".
tabIdNoTab to act on. Defaults to the session target tab (see tab_select).
repeatNoPress this many times (default 1).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare this is not read-only and acts on an open world, so the safety profile is covered. The description adds one genuinely useful behavioral fact — keys are sent to the currently focused element, with no selector targeting — but does not mention what happens if nothing is focused, whether events bubble/native, or the repeat behavior.

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?

A single front-loaded sentence with the examples doing the heavy lifting and no wasted words. Well sized for a three-parameter keyboard tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, and the three parameters are fully documented in the schema, so the description only needs to cover selection and behavior. It covers key syntax and the focus requirement but omits the fallback behavior when no element is focused and the repeat/tab-targeting implications.

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 the baseline is 3. The description earns a bump by illustrating the key-naming convention ('Enter', 'Escape', 'Control+A', 'Shift+Tab', 'ArrowDown'), which clarifies modifier joining and named-key spelling beyond the schema's terse 'joined with +' note.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Presses a key or key combination') and gives concrete examples of the input format. It does not explicitly differentiate itself from the sibling `type` tool (text entry) or `click`, which is the main remaining ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'on the focused element' implies the precondition that an element must already have focus, which is useful implied usage. However, there is no explicit when-to-use/when-not guidance and no mention of the alternative `type` tool for entering text, leaving the agent to infer the boundary.

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