Skip to main content
Glama

mp_callWx

Directly invoke any WeChat Mini Program API by passing the method name and arguments. Use for scroll, clipboard, storage, and other wx.* operations.

Instructions

调用微信小程序 API。method 不带 wx. 前缀(内部自动拼),例如传 pageScrollTo 而非 wx.pageScrollTo。args 是按位置依次展开的参数数组:多数 wx API 收单个 options 对象,所以传 [{ scrollTop: 0, duration: 300 }](数组里放那一个 options 对象),而不是裸对象。返回 {method, arguments, result},result 为 API 返回值。

何时用:直接触发 wx.* 能力(滚动、剪贴板、storage 等)。要读 / 改 page.data 或跑任意页面逻辑用 mp_evaluate(注:个别环境的 evaluate 注入通道不可用、对任意函数都报 'is not a function',此时改用 page_getData / page_setData / page_callMethod 兜底);要等某条件就绪用 mp_pollUntil。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNo
methodYes
maxBytesNo
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。
Behavior4/5

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

With no annotations, the description carries full burden. It explains the method prefix removal, argument expansion, return format, and notes the evaluate injection channel fallback. However, it lacks details on error handling or side effects of the API call.

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?

The description is well-structured: core action first, then parameter details, then usage guidance. Every sentence adds value without redundancy. Efficient and front-loaded.

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?

Given 4 parameters and no output schema, the description covers the main parameters, return format, and usage scenarios. Minor omission: 'maxBytes' parameter not addressed. Overall sufficient for effective tool selection.

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?

The schema has low description coverage (25%), but the description substantially compensates by explaining the 'method' naming and 'args' structure with examples. The 'maxBytes' parameter is not explained, but its purpose is inferable from context.

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 calls WeChat Mini Program APIs, specifies the method naming convention (no 'wx.' prefix), and distinguishes from siblings like mp_evaluate (for page logic) and mp_pollUntil (for waiting). It directly addresses the verb+resource and differentiates from similar tools.

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 (directly trigger wx.* capabilities) and when not to use (for page data or waiting), with fallback alternatives provided. The '何时用' section offers clear decision guidance.

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