Skip to main content
Glama

tool_element_action

Perform an action on a UI element by the ref from element_at_point — this is the focus-free path: a UI Automation pattern is delivered to the element, so the window is never raised and z-order never matters.

Instructions

Perform an action on a UI element by the ref from element_at_point — this is the focus-free path: a UI Automation pattern is delivered to the element, so the window is never raised and z-order never matters. MUTATING (soft): serialized across agent sessions; NO physical input is injected, so it can run while the user types — just do not operate the very window the user is working in. action must be one of the actions listed for that element (press, set_value, select, toggle, expand, collapse, scroll_into_view, focus); set_value also needs text. Refuses with the supported list when the element does not offer the action.

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>",
      "action": "<action>"
    },
    "name": "tool_element_action"
  }
}

Input Schema

NameRequiredDescriptionDefault
refYes
textNo
actionYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.5.0
    • addedInput schema / properties / text / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / text / default
      Previous value: -""New value: +null
    • removedInput schema / properties / text / type
      Removed value: -"string"
  2. First observedv0.3.1

TDQS

A4.3/5.0
Behavior3/5

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

With no annotations at all, the description carries the full burden and does a lot: it discloses that the tool mutates, that it is serialized across agent sessions, that no window is raised and no physical input is injected, and that failures return the supported action list. Missing is any statement about what an action destroys or whether it is reversible (e.g. overwriting existing text via set_value).

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?

Front-loaded with the mechanism and the risk caveat, then the parameter rules, then the failure mode — a sensible order. Slightly dense with dash clauses and shouted tokens ("MUTATING (soft)", "NO physical input") that cost a little readability without adding information.

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

Completeness5/5

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

An output schema exists so return values need not be described, and the remaining gaps an agent would care about for a mutating UI tool — safety profile, concurrency, user interference, action validity, failure behavior — are all covered. Nothing essential is left to inference.

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?

Schema coverage is 0%, so the description must compensate, and it does: it names all eight valid `action` values inline, explains that `action` must be one the target element supports, and gives the conditional requirement that `set_value` also needs `text`. `ref` is tied to its producer tool, which is the key semantic an agent needs.

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 ("Perform an action on a UI element") and pins the identifier source to `ref` from element_at_point. It immediately distinguishes itself from the physical-input siblings by calling itself "the focus-free path" and explaining the UI Automation pattern delivery.

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?

Gives clear context for use (ref comes from element_at_point, action must be one of the element's listed actions) and an explicit when-not: do not operate the very window the user is working in. It never names the physical-input alternative tools (e.g. tool_click_at, tool_element_action_at), so the routing decision is described by mechanism rather than by sibling name.

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