Handle a JavaScript dialog
handle_dialogAccept or dismiss open browser alert, confirm, prompt, and beforeunload dialogs in a tab, entering text into prompt dialogs before acceptance.
Instructions
Accept or dismiss an open alert/confirm/prompt/beforeunload dialog in a tab. For prompt dialogs, text is entered 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": {
"tabId": "<tabId>",
"action": "<action>"
},
"name": "handle_dialog"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Text to enter into a prompt() dialog before accepting. | |
| tabId | Yes | Tab ID from tabs_context / tabs_create. | |
| action | Yes |