Skip to main content
Glama
FutureAtoms

Agentic Control Framework (ACF)

by FutureAtoms

browser_handle_dialog

Automatically manage browser dialogs like alerts, confirmations, and prompts during automation.

Instructions

browser handle dialog

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual handler function for browser_handle_dialog. Uses Playwright's page.once('dialog') to register a dialog handler that either accepts (optionally with promptText) or dismisses the dialog.
    /**
     * Handle browser dialogs
     */
    async function browserHandleDialog(accept, promptText) {
      try {
        const page = await getPage();
        
        // Set up dialog handler
        page.once('dialog', async dialog => {
          if (accept) {
            await dialog.accept(promptText || '');
          } else {
            await dialog.dismiss();
          }
        });
    
        return {
          success: true,
          message: `Dialog handler set: ${accept ? 'accept' : 'dismiss'}`,
          accept,
          promptText
        };
    
      } catch (error) {
        logger.error(`Error handling dialog: ${error.message}`);
        return {
          success: false,
          message: error.message
        };
      }
    }
  • Registration of browser_handle_dialog as an extended browser tool in the tools/list schema response.
    const browserExtras = [
      { n:'browser_navigate_back' }, { n:'browser_navigate_forward' }, { n:'browser_hover' }, { n:'browser_drag' },
      { n:'browser_select_option' }, { n:'browser_press_key' }, { n:'browser_snapshot' }, { n:'browser_console_messages' },
      { n:'browser_network_requests' }, { n:'browser_tab_list' }, { n:'browser_tab_new' }, { n:'browser_tab_select' },
      { n:'browser_tab_close' }, { n:'browser_file_upload' }, { n:'browser_wait' }, { n:'browser_wait_for' },
      { n:'browser_resize' }, { n:'browser_handle_dialog' }
    ];
  • The switch-case dispatch that calls browserTools.browserHandleDialog(args.accept, args.promptText) when tool name matches 'browser_handle_dialog'.
    case 'browser_handle_dialog': data = await browserTools.browserHandleDialog(args.accept, args.promptText); break;
  • Helper function getPage() used by the handler to get or create the current Playwright page.
    /**
     * Get current page or create new one
     */
    async function getPage() {
      if (!page || page.isClosed()) {
        const browser = await getBrowser();
        if (!context) {
          context = await browser.newContext();
        }
        page = await context.newPage();
      }
      return page;
    }
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, and the description gives no behavioral details such as whether it blocks, requires a specific dialog type, or what triggers it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Extremely short but under-specified; it is not concise in a helpful way, as it omits necessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Even with no parameters, the description is insufficient. It does not explain the tool's role among many browser siblings, and no output schema exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Zero parameters, so schema coverage is 100%, but the description fails to add meaning beyond the empty schema. Baseline 4 is not justified due to lack of explanatory context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description is a tautology, merely restating the name 'browser handle dialog' without specifying the action (accept, dismiss, etc.) or the resource (type of dialog).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like browser_press_key or other browser tools. Missing context for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/FutureAtoms/agentic-control-framework'

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