Skip to main content
Glama

element_touch

Dispatches low-level touch events (touchstart, touchmove, touchend) to an element for custom multi-touch, long press, or segmented gestures. Use for advanced touch interactions not covered by simpler tap or swipe tools.

Instructions

对元素派发底层触摸事件(touchstart/touchmove/touchend)。多数场景不需要它:简单点击用 element_tap,滑动/拖拽用 element_swipe;只有需要自定义多点/长按/分段手势时才用本工具。phase:'start'/'move'/'end' 是单个事件,需自己跨多次调用拼成完整手势;'sequence' 在一次调用内完成 touchstart→moves→touchend(推荐)。x/y 可选,相对元素左上角的像素坐标,默认取元素中心。moves[] 仅在 'sequence' 下使用,是中间移动点序列(每点可带 delayMs)。holdMs:touchstart 后按住的毫秒数(长按)。identifier:触摸点 id(多指时区分,默认 1)。waitMs:整个手势后额外等待毫秒。innerSelector:定位自定义组件内部元素(selector 定位组件)。selector 支持 [index=N](仅作用于 selector)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xNo
yNo
movesNo
phaseYes
holdMsNo
waitMsNo
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。
identifierNo
innerSelectorNo
Behavior4/5

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

无注解,描述承担全部负担。说明触发底层触摸事件,区分 phase 和 sequence 的行为,以及参数如 holdMs(长按)、identifier(多指)等。但未提及返回值或潜在副作用,不过对于触摸工具而言已较充分。

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?

描述较长但每句都有信息量,没有浪费。先说明目的和替代方案,再解释参数。虽然可以更结构化(如分点),但整体清晰高效。

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?

对于有 10 个参数、嵌套对象、无输出 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?

描述覆盖了主要参数:phase 的选择、x/y 默认取中心、moves 仅用于 sequence、holdMs 表示长按、identifier 用于多指、waitMs、innerSelector 等。由于 schema 描述覆盖率仅 10%,描述有效补偿,为参数添加了使用语义。

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?

明确说明工具用于对元素派发底层触摸事件(touchstart/touchmove/touchend),并指出多数场景应使用 element_tap 或 element_swipe,从而与同类工具区分开。

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?

明确给出使用场景:只有需要自定义多点/长按/分段手势时才用本工具;简单点击用 element_tap,滑动/拖拽用 element_swipe。还解释了 phase 的两种模式(单次事件 vs sequence),提供清晰的指导。

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