alert
Handle native browser dialogs that block page actions: read text, accept or dismiss, or type into a prompt field.
Instructions
Handle a native browser dialog opened by alert(), confirm(), or prompt(). While one is open, other page actions fail until it is handled. get_text reads the message; accept clicks OK and dismiss clicks Cancel, which close the dialog and let the page act on the answer (this cannot be undone); send_text types into a prompt() before you accept it. Every action returns the dialog's text. Fails if no dialog is open. Custom in-page modals are not native dialogs: use click on their buttons instead.
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": "alert"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | For send_text: the text to type into the prompt() field. Ignored for other actions. | |
| action | Yes | get_text = read the message; accept = OK; dismiss = Cancel; send_text = type into a prompt() (then accept). |