Skip to main content
Glama

element_scrollTo

Scroll a scroll-view component to an absolute pixel position (x, y). Use selector for the scroll-view and innerSelector for nested elements. Only works with scroll-view; use element_swipe for other elements.

Instructions

将 scroll-view 组件滚动到指定绝对偏移(element.scrollTo(x,y))。仅对 scroll-view 组件有效,其它元素会失败;非 scroll-view 的滚动用手势 element_swipe。x/y 为目标 scrollLeft/scrollTop 像素值(绝对位置,非增量)。要定位自定义组件内部的 scroll-view,用 selector 定位组件、innerSelector 定位内部元素。selector 支持 [index=N](仅作用于 selector)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xNo
yNo
selectorYes
connectionNo可选连接覆盖(不传则用默认会话)。可用字段:mode(launch|connect)、cliPath、projectPath、wsEndpoint、timeout、port(【自动化端口】→ cli auto --auto-port,默认 9420;不是 IDE HTTP 服务端口,别把 IDE 服务端口传进来)、account、ticket、trustProject、args、cwd、autoClose、autoLaunch、launchTimeout、connectTimeout。
innerSelectorNo
Behavior5/5

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

Despite no annotations, the description fully discloses that the tool only works on scroll-view, fails on others, and explains x/y are absolute pixel values, not incremental. No contradictions.

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?

Three concise sentences in Chinese, front-loaded with the main action, no redundant information. Every sentence adds value.

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?

For a simple scroll tool with no output schema or annotations, the description covers target restriction, coordinate semantics, and component targeting adequately. No gaps.

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 description coverage is only 20%, but the description adds significant meaning: explains x/y as absolute scrollLeft/scrollTop, selector targets scroll-view, innerSelector targets internal elements. Connection parameter is partially covered by schema description.

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 clearly states the tool scrolls a scroll-view component to an absolute position, specifies it only works on scroll-view, and distinguishes from the sibling tool element_swipe for non-scroll-view scrolling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use (scroll-view components) and when not to (other elements, refer to element_swipe). Also provides guidance on targeting inner scroll-views using selector and innerSelector.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Chaixueyuan/weapp-agent-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server