handle_dialog
Accepts or dismisses JavaScript dialogs (alert, confirm, prompt, beforeunload) open on a browser tab so page-code tools can run again. Returns the dialog and acceptance state.
Instructions
Accepts or dismisses the JavaScript dialog (alert, confirm, prompt, beforeunload) open on the tab. While one is open, tools that run page code fail naming it. Returns {accepted, dialog}; fails when none is open.
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": {
"accept": "<accept>"
},
"name": "handle_dialog"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accept | Yes | true = OK / Leave, false = Cancel / Stay. | |
| tab_id | No | Default: the active tab. | |
| instance_id | No | Default: 'default'. | |
| prompt_text | No | Answer to a prompt when accepting it. Default: its default answer. |