Navigate the mini program
mp_navigateRoutes mini program pages via navigate, redirect, relaunch, tab switch, or back, and waits until the expected path is observed; reports a timeout with the stuck page if navigation never lands.
Instructions
Route the mini program (navigate_to, redirect_to, re_launch, switch_tab, navigate_back) and wait until the app actually lands. Returns as soon as the expected path is observed, instead of sleeping a fixed interval, so a fast transition costs milliseconds. A navigation that never lands reports a timeout with the page it was stuck on.
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_navigate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Target page path, e.g. "/pages/detail/index?id=7". Required for every action except navigate_back. | |
| action | Yes | Route call: navigate_to (push), redirect_to (replace), re_launch (reset stack), switch_tab (tab bar), navigate_back (pop). | |
| settle_ms | No | Extra wait after the new page is reached, for data loads. Defaults to 0. | |
| timeout_ms | No | How long to wait for the landing page. Defaults to 10000. | |
| expected_path | No | Path the app must land on before the call returns, e.g. "pages/detail/index". Defaults to the url path, or to the observable effect of the action. |