Skip to main content

app_alert

This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET

Read a system dialog, or answer it. A permission prompt is not part of the app — it is another process's window, and app_current reports that process while one is up. With no action it reports whether a dialog is up, what it says and its buttons, in the order it shows them; finding none is an answer rather than an error. accept and dismiss mean yes and no, so they answer only a dialog of one or two buttons — the two-button permission prompts, where accept grants and dismiss denies, and an alert's confirm and cancel. They need no knowledge of what the buttons say, so they work in any language. A dialog of three or more is refused, naming its buttons: there more than one may mean yes — iOS's location prompt has Allow Once and Allow While Using App, Android's camera and location prompts While using the app and Only this time — and on iOS accept pressed the cancel button, which iOS moves to the bottom. button presses one by its caption or its position from 1, on any dialog, an app's own included; a caption matches in any case and with straight or curly quotes. Every answer says in pressed which button it pressed. An Apple TV has no touch, so there every answer is refused naming the remote: move focus with the D-pad and press select. Answering discards the refs from the last app_map, since they named a screen with a dialog over it.

Changes the device, the app or the session: readOnlyHint is false.

Arguments​

NameTypeRequiredWhat it is
actionstring: accept, dismiss, read"accept" (yes) or "dismiss" (no) on a dialog of one or two buttons, or omitted to read.
buttonstringPress this button instead of accepting or dismissing: its caption, as a read lists it, or its position from 1 in that order. Not with action.
devicestringDevice serial to target, e.g. "emulator-5554". Omit when only one device is running.
driverstring: uiautomator2, uiautomator, wdaDriver to use: "uiautomator2" (default for Android; fast, installs a server APK on first use), "uiautomator" (Android, installs nothing, slower, cannot type), or "wda" (WebDriverAgent: iOS simulators and iPhones).
textstringText to type into a prompt's field, sent before any action so one call can fill and confirm. A plain alert has no field and the platform says so.

Examples​

Each is the arguments of a tools/call request; the first is shown whole.

Ask whether a dialog is up, what it says, and its buttons​

{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "app_alert",
"arguments": {}
}
}

On an Android 15 emulator the answer's text was:

a dialog is on screen: "Discard changes?\nThey will be lost."
buttons: "KEEP EDITING", "DISCARD"

mobium alert on an Android 15 emulator

mobium alert on an Android 15 emulator

Say yes to a dialog of one or two buttons​

{
"action": "accept"
}

On an Android 15 emulator the answer's text was:

accepted the dialog "Discard changes?\nThey will be lost.": pressed "DISCARD"
BeforeAfter
Before: mobium alert accept on an Android 15 emulatorAfter: mobium alert accept on an Android 15 emulator

mobium alert accept on an Android 15 emulator

Press a button by its caption, on a dialog of three​

{
"button": "Don't Save"
}

On an Android 15 emulator the answer's text was:

pressed "DON'T SAVE" on the dialog "Save this draft?\nYou can come back to it later."
BeforeAfter
Before: mobium alert --button "Don't Save" on an Android 15 emulatorAfter: mobium alert --button "Don't Save" on an Android 15 emulator

mobium alert --button "Don't Save" on an Android 15 emulator