Skip to main content
Glama

press_key

Simulate keyboard input on the focused widget of a PySide6 app. Use named keys (Enter, Escape, arrows) or single characters to trigger actions, navigate, and test UI behavior.

Instructions

Press a key on the currently focused widget. Named keys: enter, return, escape, tab, backtab, backspace, delete, up, down, left, right, space, home, end, pageup, pagedown, f1–f6 Single characters: pass the character directly, e.g. 'a', 'A', '1'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes
pidNoApp pid from launch_app. Omit to target the last launched app. Required only when several apps are running and you need a specific one.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior3/5

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

With no annotations, the description carries the behavioral disclosure burden. It clearly discloses the focus requirement ('currently focused widget') and enumerates supported named keys and character input. However, it does not mention what happens if no widget is focused, whether the app must be foregrounded, or how failures are surfaced.

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?

The description is compact, front-loaded with the core operation, and then organized into a clear list of accepted keys and character input. Every sentence adds necessary information with no filler.

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?

The tool is simple, with two parameters and an output schema. The description covers the key format and focus precondition, while the schema covers pid. It is nearly complete for the agent to invoke correctly, though an explicit pointer to type_text for multi-character input would strengthen context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The key parameter is entirely undocumented in the schema, and the description thoroughly compensates by listing all named keys and explaining single-character pass-through. The pid parameter is already well described in the schema, so combined coverage is strong.

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 states a specific action — 'Press a key on the currently focused widget' — which clearly identifies the tool's operation and target. It distinguishes itself from sibling tools like click, double_click, and type_text by focusing on key input rather than mouse actions or text entry.

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 description implies when to use this tool: when a key needs to be sent to the focused widget, rather than clicking or typing text. However, it does not explicitly name alternatives or state when not to use it, leaving some inference to the agent.

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

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/com55/pyside6-mcp'

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