Skip to main content
Glama

Robot Actions — Remote Device Control

device_scroll_to_element

Scroll the screen until an element matching ANY of the provided locators (text, contentDesc, resourceId) appears, then return its coordinates in PHYSICAL pixels. Scrolls up to maxScrolls times.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNoVisible text of the element (matches text or content-desc)
udidYesDevice serial number (UDID)
directionNoScroll direction (default: down)
maxScrollsNoMax scroll attempts (default: 5)
resourceIdNoResource ID (e.g. com.android.settings:id/switch_widget)
contentDescNoContent description / accessibility label

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It discloses that the tool scrolls up to maxScrolls times, matches ANY provided locator, and returns coordinates in physical pixels. However, it does not state what happens if the element is not found after maxScrolls, whether the scroll direction is respected for both up/down, or if there are side effects like screen state changes. This is useful but incomplete behavioral disclosure.

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?

Two sentences with no wasted words. The first sentence front-loads the core action and return value, while the second specifies the scroll limit. Key details like 'PHYSICAL pixels' and 'ANY of the provided locators' are included efficiently.

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 a tool with no output schema, the description adequately covers the main behavior, return type (coordinates), and locator logic. It mentions scroll direction is configurable via the parameter, and maxScrolls is a limit. Missing is failure behavior (e.g., error if not found) and whether coordinates are relative to the screen or viewport, but these are common assumptions. Given the tool's moderate complexity, the description is mostly complete.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds valuable semantics by explaining that the locators are combined with OR logic ('matching ANY of the provided locators'), which is not obvious from the individual optional parameters. It also clarifies that maxScrolls caps the number of scroll attempts and reinforces the output as physical-pixel coordinates. This goes beyond the raw schema information.

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 verb and resource: 'Scroll the screen until an element... appears, then return its coordinates in PHYSICAL pixels.' It clearly identifies the locator types (text, contentDesc, resourceId) and the unique behavior of scrolling to an element, which differentiates it from sibling tools like device_find_element (no scrolling), device_wait_for_element (no scrolling), and ios_scroll_to_element (platform-specific). The mention of PHYSICAL pixels adds a critical distinguishing detail.

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 usage: use when an element is not currently on screen and you need its coordinates after scrolling. However, it provides no explicit guidance on when to prefer this tool over siblings like device_find_element, device_wait_for_element, or device_scroll. There are no alternatives named or exclusions stated, leaving the routing decision to the agent's inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources