Query mini program elements
mp_queryLists 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
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum matches to describe. Defaults to 20, max 100. | |
| xpath | No | Treat selector as XPath (page level only). | |
| selector | Yes | WXML/CSS selector to search for, e.g. ".list-item" or "button". | |
| container_selector | No | Resolve this selector first, then search inside it. |