Handle dialog
dialogAccepts or dismisses the currently open JavaScript alert, confirm, prompt, or beforeunload popup in a tab, with optional prompt text before accepting.
Instructions
Accepts or dismisses the JavaScript dialog (alert, confirm, prompt, beforeunload) currently open in the tab.
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": "dialog"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tabId | No | Tab to act on. Defaults to the session target tab (see tab_select). | |
| action | Yes | What to do. | |
| promptText | No | Text to enter into a prompt() before accepting. |