Skip to main content
Glama
weapp-driver-mcp

weapp-driver-mcp

by Gao12123

Assert a mini program condition

mp_expect

Evaluates assertions against a running WeChat Mini Program, reporting pass/fail with observed values and treating failed checks as normal results so one run can surface every broken expectation.

Instructions

Evaluate one assertion against the running app and report pass/fail with the observed value. A failed assertion is a normal result, not an error: check pass and keep going, so one run can surface every broken expectation. Targets cover page data, the route, element text/value/attribute/data, and element counts. Types are compared strictly — "false" does not equal false.

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": {
      "target": "<target>"
    },
    "name": "mp_expect"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoAttribute name for element_attribute.
pathNoPage data path for page_data, or the route for page_path.
indexNoWhich match to read for element_text/attribute/value/data. Defaults to 0.
xpathNoTreat selector as XPath.
targetYesWhat is observed: page_data, page_path, element_text, element_attribute, element_value, element_count, element_exists, element_data.
matcherNoComparison. Defaults per target: equals (most), count (element_count), truthy (element_exists).
expectedNoValue compared against. Omit for exists/truthy. Use a regex source string for matches, a number for count, an array for one_of.
selectorNoElement selector for the element_* targets.
data_pathNoPath inside a custom component data object for element_data.
container_selectorNoResolve this first and search inside it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose non-obvious behavior: failures are returned as results rather than errors, the `pass` field is the success signal, and comparisons are strict so the string "false" is not the boolean false. That strict-typing warning is exactly the kind of trap an agent would otherwise fall into. It does not say what happens when a selector matches nothing or how the tool behaves mid-navigation, which keeps it off 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.

Conciseness4/5

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

Four short sentences, front-loaded with purpose and then the most valuable caveat (a failure is not an error). Every sentence contributes something. Minor friction: it references a `pass` field with no output schema to anchor it, and the target enumeration partially duplicates the enum.

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 ten-parameter, annotation-free tool with no output schema, the description covers purpose, target scope, result interpretation, and type-comparison semantics — enough to call it correctly in the common case. The remaining gap is output shape beyond `pass` (observed value, match index) and behavior when nothing matches, which an agent would have to discover empirically.

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%, so every one of the ten parameters is already documented, including per-target matcher defaults, the expected-value conventions, and the index default. The description's target list largely restates the `target` enum, though the strict-comparison note adds genuine meaning about how `expected` and `matcher` interact. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb and resource: 'Evaluate one assertion against the running app and report pass/fail with the observed value.' It also enumerates the observation targets (page data, route, element text/value/attribute/data, element counts), which separates it from read-only siblings like mp_element_read or mp_query. It stops short of naming an alternative outright, but the assert-vs-read identity is unmistakable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives real guidance on interpreting results: a failed assertion is a normal result, so check `pass` and continue to surface every broken expectation in one run. That is result-handling guidance rather than selection guidance — it never says when to prefer mp_expect over a plain read such as mp_element_read, or which target to pick for a given check.

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