Skip to main content
Glama
computer
by zznabil

Press keys in element

element_press_keys
Destructive

Sends a key chord to a focused UI element to trigger shortcuts or keyboard actions.

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 to follow the plugin setting ("prefer" uses real input first, "fallback" tries background input first, "refuse" disables takeover). Use true for reliable input in Chromium (including Brave), Electron, and terminal hosts when takeover is allowed. Takeover brings the window forward and can interrupt the user. For window targets, use false to request background-only input; desktop and display targets send real input.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.11.0
    • changedInput schema / properties / takeover / description
      Previous value: -"Omit (default): background first; the server decides any takeover. true: activate the window and post real input now. false: background only, never take over."New value: +"Omit to follow the plugin setting (\"prefer\" uses real input first, \"fallback\" tries background input first, \"refuse\" disables takeover). Use true for reliable input in Chromium (including Brave), Electron, and terminal hosts when takeover is allowed. Takeover brings the window forward and can interrupt the user. For window targets, use false to request background-only input; desktop and display targets send real input."
  2. First observedv0.2.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, openWorldHint=true, and idempotentHint=false, so the risky profile is covered structured. The description adds one genuinely behavioral fact beyond that: input targets whatever currently holds keyboard focus, so focus must be established first or the keystrokes go elsewhere. It omits that chords can trigger application-level shortcuts and says nothing about the takeover side effect, which is only buried in the schema.

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 zero filler; the precondition is attached to the action rather than padded into a separate clause. Nothing in it is redundant with structured fields.

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

Completeness2/5

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

For a destructive, non-idempotent tool that can fire application shortcuts, one sentence is thin: it never warns that a chord like ctrl+s or ctrl+w has side effects, never says how errors surface when the element lacks focus, and never helps disambiguate from the many keyboard siblings. With no output schema, the description carries the whole burden of explaining call outcome and it doesn't.

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%, and the schema already documents ref, keys (with chord examples), and the takeover modes in detail. The description adds no parameter meaning beyond that, so the baseline of 3 applies.

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 ("Press a key chord in an element") plus a precondition ("once it holds keyboard focus"), so an agent knows exactly what action is performed. It does not distinguish this from near-identical siblings such as press_keys, element_press, or hold_keys, leaving the agent to guess which to choose.

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 the element must be focused first (element_focus), which is useful implied usage guidance. There is no explicit when-to-use vs. when-not-to-use guidance, no statement about when press_keys or hold_keys would be preferable, and no mention of what happens if the element isn't focused.

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