Skip to main content
Glama

Act on a UI control

sandbox_ui_action

Find a UI control by name, automationId, or controlType and act on it via UI Automation: click, set a value, toggle, select, expand, focus, or read its state.

Instructions

Find a control by name / automationId / controlType (any combination) and act on it through UI Automation: click (Invoke, Toggle, Select or ExpandCollapse as appropriate, else a real mouse click), doubleclick, rightclick, setvalue (type into an edit box), toggle, select, expand, collapse, focus, or read (just return its state). Use sandbox_ui_tree first to see names. If a click opens a modal dialog the result is {pending:true}; that is fine.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "sandbox_ui_action"
  }
}

Input Schema

NameRequiredDescriptionDefault
pidNoProcess whose windows to search (from sandbox_launch).
nameNoElement name (visible label), exact match; falls back to contains.
indexNoWhich match to use when several match (default 0).
valueNoText for setvalue.
actionNoDefault click.
controlTypeNoButton, Edit, CheckBox, ComboBox, ListItem, MenuItem, TabItem, Text, ...
windowTitleNoOr: a window whose title contains this text.
automationIdNoAutomationId (control name in WinForms/WPF), exact match.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does meaningful work: it discloses the UI Automation fallback chain (Invoke, Toggle, Select or ExpandCollapse as appropriate, else a real mouse click) and warns that a click opening a modal returns {pending:true}. It omits failure modes (element not found), timeouts/waits, and whether actions require the target window to be focused or foregrounded.

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?

The description is front-loaded with purpose, followed by ordering guidance and a caveat about modal results; every sentence contributes. The long inline enumeration of actions makes the opening sentence dense and harder to scan, but no wording is truly wasteful.

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?

For an eight-parameter, no-output-schema, no-annotation mutation tool, the definition covers the mechanism, the prerequisite tool, and one important return-shape quirk ({pending:true}). What is missing is what 'read' returns and how failures surface, which matters since there is no output schema to fall back on.

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%, so every parameter is already documented in the input schema. The description only adds that locators may be combined ('any combination') and clarifies action-to-intent mappings such as setvalue typing into an edit box, which are largely restatements or minor additions to what the schema already conveys.

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 opens with a specific verb-and-resource pair: find a control by name/automationId/controlType and act on it via UI Automation. It then enumerates the full action vocabulary (click, doubleclick, rightclick, setvalue, toggle, select, expand, collapse, focus, read), so an agent knows exactly what capability this tool exposes without opening the schema.

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?

It gives an explicit prerequisite: 'Use sandbox_ui_tree first to see names,' which establishes the call ordering an agent needs. It stops short of explicit when-not guidance or differentiating itself from siblings like sandbox_click and sandbox_type, which could plausibly overlap with its click/setvalue actions.

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