You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/site/docs/en/api.mdx
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,8 @@ All agents share these base options:
39
39
- For mobile devices, setting `screenshotShrinkFactor` to 2 can reduce token consumption while maintaining clarity, but it is not recommended to set it higher than 3, as this may cause the image to be too blurry and affect the AI model's understanding.
40
40
- For web pages, if the content is complex or contains a lot of details, it is not recommended to set `screenshotShrinkFactor` to avoid overly blurry screenshots. Additionally, if you want higher clarity for web page screenshots, you can configure Puppeteer or Playwright's `deviceScaleFactor` to 2, which will allow Puppeteer or Playwright to render the page as if it were a high-definition screen.
41
41
42
+
The MCP tools and device CLIs expose these same Agent behavior options per call. In CLIs, convert the camelCase API option to a bare kebab-case flag, such as `waitAfterAction` -> `--wait-after-action`. In MCP calls, keep the camelCase option under the platform namespace, such as `android.waitAfterAction` or `web.waitAfterAction`. See [Configure Agent behavior per call](./mcp#configure-agent-behavior-per-call) for examples.
43
+
42
44
### Custom model configuration
43
45
44
46
Use `modelConfig: Record<string, string | number>` to configure models directly in code instead of environment variables.
Copy file name to clipboardExpand all lines: apps/site/docs/en/mcp.mdx
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -192,24 +192,25 @@ A per-call value always wins over the startup flag: action tools accept `locate.
192
192
193
193
## Configure Agent behavior per call
194
194
195
-
MCP tools and the device CLIs also accept common Agent behavior parameters. Use them when a target UI needs a longer settle time, a different `act` replanning limit, extra action context, or smaller screenshots.
195
+
MCP tools and the device CLIs also accept common Agent behavior parameters. Use them when a target UI needs a longer settle time, a different `act` replanning limit, extra action context, or smaller screenshots. These parameters are the per-call form of the same Agent options documented in [API reference (Common)](./api#parameters).
196
196
197
-
In the device CLIs, pass the bare kebab-case flags on each command that should use them:
197
+
In the device CLIs, convert the API camelCase option name to a bare kebab-case flag and pass it on each command that should use it. The generated CLI also accepts the original camelCase alias shown in `--help`, but docs and examples use kebab-case:
198
198
199
199
```bash
200
200
midscene-android tap --locate "the login button" --wait-after-action 800
midscene-ios assert --prompt "the success message is visible" --screenshot-shrink-factor 2
203
203
```
204
204
205
-
Available flags:
205
+
Common flags:
206
206
207
-
-`--wait-after-action <ms>`: wait time after each action execution. The default is `300`.
208
-
-`--replanning-cycle-limit <n>`: maximum number of `aiAct` replanning cycles.
209
-
-`--ai-act-context <text>`: extra background knowledge for `aiAct`.
210
-
-`--screenshot-shrink-factor <n>`: shrink screenshots before sending them to the AI model.
207
+
-`--wait-after-action <ms>` maps to `waitAfterAction`: wait time after each action execution. The default is `300`.
208
+
-`--replanning-cycle-limit <n>` maps to `replanningCycleLimit`: maximum number of `aiAct` replanning cycles.
209
+
-`--ai-act-context <text>` maps to `aiActContext`: extra background knowledge for `aiAct`.
210
+
-`--ai-action-context <text>` maps to `aiActionContext`: deprecated alias for `aiActContext`.
211
+
-`--screenshot-shrink-factor <n>` maps to `screenshotShrinkFactor`: shrink screenshots before sending them to the AI model.
211
212
212
-
In MCP calls, use the same camelCase names under the platform namespace: `android.waitAfterAction`, `harmony.waitAfterAction`, `ios.waitAfterAction`, `computer.waitAfterAction`, or `web.waitAfterAction`. The same pattern applies to `replanningCycleLimit`, `aiActContext`, and `screenshotShrinkFactor`.
213
+
In MCP calls, keep the API camelCase name and put it under the platform namespace: `android.waitAfterAction`, `harmony.waitAfterAction`, `ios.waitAfterAction`, `computer.waitAfterAction`, or `web.waitAfterAction`. The same pattern applies to `replanningCycleLimit`, `aiActContext`, `aiActionContext`, and `screenshotShrinkFactor`.
213
214
214
215
These parameters are part of the Agent init args for that tool call. If a later call changes them, or omits them after setting them, Midscene rebuilds the Agent so the next call uses the new effective configuration. For Web tools, `web.url` opens or navigates to the URL each time it is supplied; omit it to keep using the current page.
0 commit comments