element_callMethod调用组件实例指定方法,仅自定义组件可以使用。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"selector": {
"type": "string",
"minLength": 1
},
"innerSelector": {
"type": "string",
"minLength": 1
},
"method": {
"type": "string",
"minLength": 1
},
"args": {
"type": "array",
"items": {}
}
},
"required": [
"selector",
"method"
]
} | — | | — |
element_getAttributes获取元素的特性值。names 为特性名数组(如 ['class', 'id', 'data-index'])。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"selector": {
"type": "string",
"minLength": 1
},
"innerSelector": {
"type": "string",
"minLength": 1
},
"names": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
}
},
"required": [
"selector",
"names"
]
} | — | | — |
element_getBoundingClientRect获取元素相对于视口的边界矩形信息(left、top、width、height、right、bottom)。此方法返回的是考虑 CSS transform 变换后的实际渲染尺寸和位置。仅支持 ID 选择器、类选择器。若目标元素位于自定义组件内部,selector 必须指向当前页面 WXML 源码中直接引用的那一层自定义组件,而不是渲染后的组件树;innerSelector 可在 selector 所指组件的整个子树内匹配。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"selector": {
"type": "string",
"minLength": 1
},
"innerSelector": {
"type": "string",
"minLength": 1
}
},
"required": [
"selector"
]
} | — | | — |
element_getData获取组件实例渲染数据,仅自定义组件可以使用。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"selector": {
"type": "string",
"minLength": 1
},
"innerSelector": {
"type": "string",
"minLength": 1
},
"path": {
"type": "string",
"minLength": 1
}
},
"required": [
"selector"
]
} | — | | — |
element_getInnerElement在元素范围内获取元素,相当于 element.$(selector)。设置 withWxml 为 true 可额外返回每个元素的完整 outerWxml。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"selector": {
"type": "string",
"minLength": 1
},
"innerSelector": {
"type": "string",
"minLength": 1
},
"targetSelector": {
"type": "string",
"minLength": 1
},
"withWxml": {
"default": false,
"type": "boolean"
}
},
"required": [
"selector",
"targetSelector"
]
} | — | | — |
element_getInnerElements在元素范围内获取元素数组,相当于 element.$$(selector)。设置 withWxml 为 true 可额外返回每个元素的完整 outerWxml。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"selector": {
"type": "string",
"minLength": 1
},
"innerSelector": {
"type": "string",
"minLength": 1
},
"targetSelector": {
"type": "string",
"minLength": 1
},
"withWxml": {
"default": false,
"type": "boolean"
}
},
"required": [
"selector",
"targetSelector"
]
} | — | | — |
element_getStyles获取元素的样式值。names 为样式名数组(如 ['color', 'fontSize', 'backgroundColor'])。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"selector": {
"type": "string",
"minLength": 1
},
"innerSelector": {
"type": "string",
"minLength": 1
},
"names": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
}
},
"required": [
"selector",
"names"
]
} | — | | — |
element_getWxml获取元素 WXML。默认获取内部 WXML(element.wxml()),设置 outer 为 true 可获取包含元素本身的 WXML(element.outerWxml())。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"selector": {
"type": "string",
"minLength": 1
},
"innerSelector": {
"type": "string",
"minLength": 1
},
"outer": {
"default": false,
"type": "boolean"
}
},
"required": [
"selector"
]
} | — | | — |
element_input向指定元素输入文本。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"selector": {
"type": "string",
"minLength": 1
},
"innerSelector": {
"type": "string",
"minLength": 1
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
}
]
}
},
"required": [
"selector",
"value"
]
} | — | | — |
element_scrollTo滚动 scroll-view 组件到指定位置。仅适用于 scroll-view 组件。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"selector": {
"type": "string",
"minLength": 1
},
"innerSelector": {
"type": "string",
"minLength": 1
},
"x": {
"type": "number"
},
"y": {
"type": "number"
}
},
"required": [
"selector",
"x",
"y"
]
} | — | | — |
element_setData设置组件实例渲染数据,仅自定义组件可以使用。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"selector": {
"type": "string",
"minLength": 1
},
"innerSelector": {
"type": "string",
"minLength": 1
},
"data": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"required": [
"selector",
"data"
]
} | — | | — |
element_tap通过 CSS 选择器模拟点击 WXML 元素。支持 [index=N] 语法选择第 N 个元素。如需点击自定义组件内部的元素,请使用 innerSelector 参数:selector 设为组件 ID 选择器(如 #my-component)或标签选择器,innerSelector 设为组件内部元素的选择器。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"selector": {
"type": "string",
"minLength": 1
},
"innerSelector": {
"type": "string",
"minLength": 1
},
"waitMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"selector"
]
} | — | | — |
mp_callWx调用微信小程序 API 方法,(如 `wx.pageScrollTo`)。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"method": {
"type": "string",
"minLength": 1
},
"args": {
"type": "array",
"items": {}
}
},
"required": [
"method"
]
} | — | | — |
mp_currentPage获取当前页面的信息,包括路径、查询参数、尺寸、滚动位置、当前页面真实渲染器 renderer,以及 wx.getSkylineInfoSync() 的 Skyline 诊断信息 skylineInfo。通常在 mp_ensureConnection 成功后立即调用,用于确认当前页面;可通过 renderer 区分 webview/skyline,skylineInfo 仅用于判断运行环境能力。withData 为 true 时额外返回页面数据。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"withData": {
"default": false,
"type": "boolean"
}
}
} | — | | — |
mp_ensureConnection检查小程序自动化会话是否就绪。先调用这个工具,再调用 mp_screenshot、page_* 或 element_* 工具。若失败,优先用 reconnect=true 重试一次;若返回项目选择提示,则传 projectSelection。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"reconnect": {
"default": false,
"type": "boolean"
},
"projectSelection": {
"type": "string"
}
}
} | — | | — |
mp_getLogs获取小程序控制台日志。可选择在获取后清空日志。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"clear": {
"default": false,
"type": "boolean"
}
}
} | — | | — |
mp_listProjects列出微信开发者工具中的最近项目,方便在 mp_ensureConnection 返回项目选择提示后继续选择项目。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {}
} | — | | — |
mp_mockWxMethod有限 mock wx 方法能力。当前仅支持 method=request:action=mock 时按 requestRules mock wx.request 成功响应;action=restore 时恢复 wx.request。未匹配请求默认透传原始 wx.request。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"action": {
"default": "mock",
"type": "string",
"enum": [
"mock",
"restore"
]
},
"method": {
"default": "request",
"type": "string",
"enum": [
"request"
]
},
"requestRules": {
"type": "array",
"items": {
"type": "object",
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"match": {
"default": "contains",
"type": "string",
"enum": [
"contains",
"exact",
"regex"
]
},
"method": {
"type": "string",
"minLength": 1
},
"statusCode": {
"default": 200,
"type": "integer",
"minimum": 100,
"maximum": 599
},
"data": {},
"header": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
"cookies": {
"type": "array",
"items": {
"type": "string"
}
},
"delayMs": {
"default": 0,
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"url"
]
}
}
}
} | — | | — |
mp_navigate在小程序内导航,支持 navigateTo、redirectTo、reLaunch、switchTab 和 navigateBack。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"path": {
"type": "string",
"minLength": 1
},
"query": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "string"
}
},
"transition": {
"default": "navigateTo",
"type": "string",
"enum": [
"navigateTo",
"redirectTo",
"reLaunch",
"switchTab",
"navigateBack"
]
},
"waitMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
}
} | — | | — |
mp_screenshot截取当前小程序视口的截图。需要已有活动会话;若提示没有活动会话,请先调用 mp_ensureConnection。默认返回内联图片,或保存到文件路径。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"path": {
"type": "string",
"minLength": 1
}
}
} | — | | — |
mp_setDefaultProject设置默认的小程序项目路径,设置后下次连接会优先使用该项目。通常用于修复项目选择失败后的后续重试。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"projectPath": {
"type": "string",
"minLength": 1
}
},
"required": [
"projectPath"
]
} | — | | — |
page_callMethod调用当前页面实例上暴露的方法。参数可以作为数组提供。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"method": {
"type": "string",
"minLength": 1
},
"args": {
"type": "array",
"items": {}
}
},
"required": [
"method"
]
} | — | | — |
page_getData获取当前页面的数据对象,可选择指定子数据路径。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"path": {
"type": "string",
"minLength": 1
}
}
} | — | | — |
page_getElement通过选择器获取页面元素,相当于 page.$(selector)。返回每个元素的摘要信息(tagName、text、value、size、offset);设置 withWxml 为 true 可额外返回元素的完整 outerWxml。支持 [index=N] 语法选择第 N 个元素。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"selector": {
"type": "string",
"minLength": 1
},
"innerSelector": {
"type": "string",
"minLength": 1
},
"withWxml": {
"default": false,
"type": "boolean"
}
},
"required": [
"selector"
]
} | — | | — |
page_getElementByXpath通过 XPath 获取页面第一个匹配元素,相当于 page.getElementByXpath(xpath) / page.xpath(xpath)。适合按文本、层级关系、ancestor/following 等 XPath 表达式定位元素;设置 withWxml 为 true 可额外返回完整 outerWxml。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"xpath": {
"type": "string",
"minLength": 1
},
"withWxml": {
"default": false,
"type": "boolean"
}
},
"required": [
"xpath"
]
} | — | | — |
page_getElements通过选择器获取页面元素数组,相当于 page.$$(selector)。返回每个元素的摘要信息(tagName、text、value、size、offset);设置 withWxml 为 true 可额外返回每个元素的完整 outerWxml。支持 [index=N] 语法选择第 N 个元素。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"selector": {
"type": "string",
"minLength": 1
},
"withWxml": {
"default": false,
"type": "boolean"
}
},
"required": [
"selector"
]
} | — | | — |
page_getElementsByXpath通过 XPath 获取页面匹配元素数组,相当于 page.getElementsByXpath(xpath)。适合按文本、属性、层级关系、位置函数等 XPath 表达式批量定位元素;设置 withWxml 为 true 可额外返回每个元素的完整 outerWxml。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"xpath": {
"type": "string",
"minLength": 1
},
"withWxml": {
"default": false,
"type": "boolean"
}
},
"required": [
"xpath"
]
} | — | | — |
page_setData使用 setData 更新当前页面的数据。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"data": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"required": [
"data"
]
} | — | | — |
page_waitElement等待指定选择器的元素出现在页面上。支持 [index=N] 语法选择第 N 个元素。增强版:增加了超时和重试间隔参数。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"selector": {
"type": "string",
"minLength": 1
},
"timeout": {
"default": 5000,
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"retryInterval": {
"default": 200,
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"selector"
]
} | — | | — |
page_waitTimeout等待指定的毫秒数。Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"connection": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"launch",
"connect"
]
},
"cliPath": {
"type": "string",
"minLength": 1
},
"projectPath": {
"type": "string",
"minLength": 1
},
"wsEndpoint": {
"type": "string",
"minLength": 1
},
"timeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"port": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"account": {
"type": "string",
"minLength": 1
},
"ticket": {
"type": "string",
"minLength": 1
},
"trustProject": {
"type": "boolean"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"cwd": {
"type": "string",
"minLength": 1
},
"autoClose": {
"type": "boolean"
},
"autoLaunch": {
"type": "boolean"
},
"launchTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectTimeout": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"milliseconds": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"milliseconds"
]
} | — | | — |