pilot_handle_dialog
Configure automatic handling of browser dialogs (alert, confirm, prompt) during automation by setting acceptance or dismissal rules and providing input text.
Instructions
Configure how dialogs (alert/confirm/prompt) are handled.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accept | Yes | true to auto-accept, false to auto-dismiss | |
| prompt_text | No | Text to provide for prompt dialogs |
Implementation Reference
- src/tools/settings.ts:163-170 (handler)The handler function for the pilot_handle_dialog tool, which configures browser dialog behavior.
async ({ accept, prompt_text }) => { await bm.ensureBrowser(); bm.setDialogAutoAccept(accept); bm.setDialogPromptText(prompt_text || null); const msg = accept ? (prompt_text ? `Dialogs will be accepted with text: "${prompt_text}"` : 'Dialogs will be accepted') : 'Dialogs will be dismissed'; return { content: [{ type: 'text' as const, text: msg }] }; - src/tools/settings.ts:156-170 (registration)The registration of the pilot_handle_dialog tool with its schema definition and handler.
server.tool( 'pilot_handle_dialog', 'Configure how dialogs (alert/confirm/prompt) are handled.', { accept: z.boolean().describe('true to auto-accept, false to auto-dismiss'), prompt_text: z.string().optional().describe('Text to provide for prompt dialogs'), }, async ({ accept, prompt_text }) => { await bm.ensureBrowser(); bm.setDialogAutoAccept(accept); bm.setDialogPromptText(prompt_text || null); const msg = accept ? (prompt_text ? `Dialogs will be accepted with text: "${prompt_text}"` : 'Dialogs will be accepted') : 'Dialogs will be dismissed'; return { content: [{ type: 'text' as const, text: msg }] };