Skip to main content
Glama
computer
by zznabil

Press keys in element

element_press_keys
Destructive

Presses a specified key chord on a keyboard-focused element to trigger element-specific shortcuts or actions during desktop automation.

Instructions

Press a key chord in an element once it holds keyboard focus.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "ref": "<ref>",
      "keys": "<keys>"
    },
    "name": "element_press_keys"
  }
}

Input Schema

NameRequiredDescriptionDefault
refYesElement ref from ax_tree/ax_find, e.g. "e12".
keysYesKey chord, e.g. "ctrl+s", "enter", "ctrl+shift+p", or ["ctrl","s"].
takeoverNoOmit (default): background first; the server decides any takeover. true: activate the window and post real input now. false: background only, never take over.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=true, openWorldHint=true, and idempotentHint=false, so the safety profile is covered. The description adds real behavioral context beyond that: the tool does not focus the element itself and requires pre-existing focus, which is a non-obvious invocation constraint. It stops short of saying whether an unfocused element yields an error or misrouted keystrokes.

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?

A single front-loaded sentence with no redundant wording or filler. It is efficient but arguably undersized for a destructive, open-world tool, since no sentence is devoted to effects or failure modes.

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?

For a destructive open-world input tool with no output schema and full schema coverage, the essentials are present but thin. The definition omits outcome behavior (what keys do to the focused element, whether it can trigger navigation or shortcuts that escape the element) and the failure mode when focus is absent.

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

Parameters3/5

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

Schema description coverage is 100%, with ref, keys (including chord format examples), and takeover fully documented in the schema, so the baseline is 3. The description adds no parameter-level detail beyond indirectly implying that 'ref' must point to a focusable element; it says nothing about the notable 'takeover' flag or key-chord format beyond what the schema already supplies.

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?

The description names a specific verb and resource ('press a key chord in an element') and adds a scoping condition ('once it holds keyboard focus'), so the agent knows exactly what the operation does. It does not distinguish itself from siblings such as press_keys, element_press, or type_text, which remain potentially confusable.

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 'once it holds keyboard focus' implies a prerequisite (the element must already be focused, presumably via element_focus), which is genuinely implied usage guidance. However, there is no explicit when-to-use versus press_keys or type_text, and no statement of what happens if the element is not focused.

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