browser_handle_dialog
Accept or dismiss JavaScript alert, confirm, prompt, or beforeunload dialogs in a specified tab, optionally supplying prompt text.
Instructions
Answers the JavaScript dialog (alert, confirm, prompt, beforeunload) open in tab tab_id (never another tab's dialog).
No dialog is ever accepted automatically: when a command opens one, its response reports it (dialog / pendingDialogs fields: type and message, for the targeted tab only). Read the message, then choose:
accept=True: OK / Leave page; accept=False: Cancel / Stay.
prompt_text: text entered in a prompt dialog before accepting.
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>",
"tab_id": "<tab_id>"
},
"name": "browser_handle_dialog"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accept | Yes | ||
| tab_id | Yes | Your tab's id (from browser_new_tab, or a tab adopted with browser_adopt_tab). | |
| prompt_text | No |