Handle JavaScript Dialog
browser_handle_dialogManage browser dialogs by setting accept or dismiss actions before they appear, then trigger the dialog and inspect the resulting navigation or state changes.
Instructions
Use when an alert, confirm, prompt, or beforeunload dialog blocks or changes the browser reproduction. Preconditions: configure the intended accept or dismiss behavior before the dialog appears. Next: trigger the dialog and inspect the resulting action, navigation, or state. Sensitivity: accepting prompts or confirmations can submit text, authorize actions, or mutate application state.
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": "browser_handle_dialog"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| once | No | ||
| action | Yes | ||
| promptText | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| error | No | ||
| result | No |