Skip to main content
Glama

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
NameRequiredDescriptionDefault
acceptYestrue to auto-accept, false to auto-dismiss
prompt_textNoText to provide for prompt dialogs

Implementation Reference

  • 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 }] };
  • 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 }] };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TacosyHorchata/Pilot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server