handle_dialog
Accept or dismiss open JavaScript browser dialogs such as alert, confirm, prompt, or beforeunload, and optionally enter text into prompt dialogs.
Instructions
Accept or dismiss an open JavaScript browser dialog (alert, confirm, prompt, or beforeunload), optionally entering text into a prompt dialog.
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 |
|---|---|---|---|
| tabId | No | Target tab ID (defaults to active managed tab). | |
| action | Yes | Whether to accept (OK) or dismiss (Cancel) the dialog. | |
| promptText | No | Optional text to enter when accepting a JS prompt() dialog. |