pilot_dialog
Retrieve browser dialog messages (alerts, confirms, prompts) from automated sessions to handle user interactions and decision points during web automation.
Instructions
Get captured dialog (alert/confirm/prompt) messages.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clear | No | Clear the buffer after reading |
Implementation Reference
- src/tools/inspection.ts:70-83 (handler)The tool 'pilot_dialog' is implemented as an anonymous async function within 'server.tool', handling browser dialog retrieval and clearing via the 'dialogBuffer'.
server.tool( 'pilot_dialog', 'Get captured dialog (alert/confirm/prompt) messages.', { clear: z.boolean().optional().describe('Clear the buffer after reading') }, async ({ clear }) => { await bm.ensureBrowser(); if (clear) { dialogBuffer.clear(); return { content: [{ type: 'text' as const, text: 'Dialog buffer cleared.' }] }; } if (dialogBuffer.length === 0) return { content: [{ type: 'text' as const, text: '(no dialogs captured)' }] }; const text = dialogBuffer.toArray().map(e => `[${new Date(e.timestamp).toISOString()}] [${e.type}] "${e.message}" → ${e.action}${e.response ? ` "${e.response}"` : ''}` ).join('\n'); return { content: [{ type: 'text' as const, text }] }; } );