Skip to main content
Glama
weapp-driver-mcp

weapp-driver-mcp

by Gao12123

Call or mock wx APIs

mp_wx

Call or mock wx APIs inside a running WeChat Mini Program to control test responses without network calls, then restore or list active mocks.

Instructions

Call a wx API inside the running mini program, or mock one so it returns a fixed result (or runs a function) without touching the network. This is the only request control the WeChat automator exposes: it replaces wx API results, it does not intercept HTTP. Mocks persist for the session; restore or restore_all removes them.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "action": "<action>"
    },
    "name": "mp_wx"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoArguments passed to the wx API for action "call".
actionYescall: invoke a wx API inside the app. mock: replace a wx API result. restore: drop one mock. restore_all: drop every mock. list_mocks: show what is mocked.
methodNowx API name, e.g. "request", "getStorageSync", "showToast". Required by call, mock and restore.
resultNoValue the mocked wx API returns for action "mock". Mutually exclusive with function_source.
function_sourceNoJavaScript function source evaluated inside the app for action "mock", e.g. "function (options) { options.success({ data: [] }) }". Only use code you wrote.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full behavioral burden and does a fair amount: mocks persist for the session, restore/restore_all undo them, mocking never hits the network, and function_source is arbitrary JS evaluated inside the app (with a caution to only use code you wrote). It doesn't say what happens if you mock an already-mocked API, whether mocks survive navigation, or what call returns, which keeps it below a 5.

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 sentences, no filler, and the core capability is front-loaded before the scope caveat and the lifecycle note. Each sentence adds a distinct piece of information: what it does, what it does not do, and how state is cleaned up.

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?

For a five-parameter, no-output-schema tool, the description covers purpose, boundaries, and mock lifecycle well enough to call it safely. The remaining gap is that list_mocks appears only in the schema enum and the description never indicates what call or list_mocks hand back, so a reader relying on prose alone would not know the return shape.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and the enum for action already spells out all five operations, so the schema does the heavy lifting. The description only adds the semantic contrast that a mock returns 'a fixed result (or runs a function)', loosely mapping to result vs function_source without naming them or noting their mutual exclusivity beyond the schema.

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 names the resource precisely (a wx API inside the running mini program) and two distinct modes (call vs mock), plus the state-management actions implied by 'restore or restore_all'. The line 'it replaces wx API results, it does not intercept HTTP' disambiguates it from any network-interception capability an agent might otherwise assume, and no sibling (mp_page, mp_query, mp_console) overlaps this role.

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?

It gives real routing context: use call to invoke, mock to fake a result without touching the network, and restore/restore_all to clean up per-session mocks. It also sets an explicit negative boundary ('it does not intercept HTTP'), which tells the agent when NOT to reach for this tool. What's missing is guidance on prerequisites (e.g. whether the app must already be launched) and when to prefer restore_all over repeated restore.

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