Skip to main content
Glama

element_swipe

Performs a real swipe gesture on an element, simulating touch sequences for lists or carousels. Specify direction and optional distance or duration.

Instructions

对元素执行真实滑动手势(自动 touchstart→多段 touchmove→touchend),适合列表/轮播/可拖拽区域等需要 touch 序列的场景。比 element_touch 简单,优先用本工具做滑动。direction:手指移动方向 up/down/left/right。distance:滑动距离 px,默认取元素宽或高的 60%。durationMs:手势总时长,默认 300。startX/startY:起点相对元素左上角的像素坐标,默认元素中心。waitMs:手势后额外等待毫秒。innerSelector:定位自定义组件内部元素(selector 定位组件)。selector 支持 [index=N](仅作用于 selector)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startXNo
startYNo
waitMsNo
distanceNo
selectorYes
directionYes
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。
durationMsNo
identifierNo
innerSelectorNo
Behavior4/5

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

Describes the gesture sequence, default parameters (distance 60% of element width/height, duration 300ms, start at center), and extra wait time. No annotations provided, so description carries the burden; 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single paragraph with front-loaded purpose and parameter list. Efficient but dense; could be structured with bullet points for readability. No wasted words.

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?

Adequate for a swipe tool with 10 parameters and no output schema. Covers purpose, usage guidance, and parameter details. Does not mention return values or errors, but not required given lacking output schema.

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?

Adds meaning beyond schema by explaining direction enum, distance default, duration default, start coordinates default, waitMs, innerSelector, and selector index support. Schema coverage is only 10%, but description compensates well.

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?

Description clearly states it performs real swipe gesture (touchstart→touchmove→touchend), specifies use case (lists, carousels, draggable areas), and distinguishes from sibling element_touch by recommending this tool for simplicity.

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?

Explicitly says to prefer this tool over element_touch for simple swipes and indicates suitable scenarios. However, does not specify when not to use it or mention alternatives.

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