handle_dialog
Set dialog handling for alerts, confirms, or prompts before they open, then accept, dismiss, or check status via CDP for reliable browser automation.
Instructions
Configure handling of alerts, confirms and prompts. Set it BEFORE triggering the action that opens the dialog. Uses CDP Page.javascriptDialogOpening, so it works even while the dialog blocks all JS.
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": "handle_dialog"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Text entered into prompt dialogs (with action accept) | |
| action | Yes | accept or dismiss the next dialog; get_status: pending ones |