Skip to main content
Glama
weapp-driver-mcp

weapp-driver-mcp

by Gao12123

Query mini program elements

mp_query

Lists elements on the current page matching a WXML/CSS selector, returning tag, class, clipped text, and total match count so you can inspect the screen and choose an element index before acting.

Instructions

List elements matching a selector on the current page, with tag name, class and clipped text for each. Use this to inspect what is on screen before acting, and to choose an index when a selector matches several elements. Returns the total match count separately from the listed page of results.

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": {
      "selector": "<selector>"
    },
    "name": "mp_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum matches to describe. Defaults to 20, max 100.
xpathNoTreat selector as XPath (page level only).
selectorYesWXML/CSS selector to search for, e.g. ".list-item" or "button".
container_selectorNoResolve this selector first, then search inside it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full burden, and it does disclose the meaningful behavior: results are a page of matches with a separate total match count, and text is "clipped" rather than full. It does not state read-only/safety semantics, permission needs, or pagination mechanics, which are the remaining gaps for an uninstrumented tool.

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?

Three tight sentences: what it does, when to use it, and what it returns. The return-shape sentence is well placed at the end and nothing is redundant, though the sentences are dense and could be slightly more scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and no annotations, the description still covers the three things an agent needs: what is queried, when to reach for it, and that results are paginated with a separate total count. Nothing essential for calling this four-parameter read tool correctly is missing.

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 selector, limit, xpath, and container_selector are already documented by the schema. The description adds only an indirect hint about why paging matters (choosing an index among multiple matches) and no syntax or format detail beyond the schema.

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?

"List elements matching a selector on the current page" gives a specific verb and resource, and the description further pins down the returned fields (tag name, class, clipped text), which distinguishes it from siblings like mp_element_action or mp_element_read. It never names an alternative tool explicitly, so the differentiation is implicit rather than stated.

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?

"Use this to inspect what is on screen before acting, and to choose an index when a selector matches several elements" gives a clear when-to-use context and even a concrete downstream reason (index selection for later actions). There are no explicit exclusions or named alternatives, so it stops short of the 5-level bar.

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