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 }] };
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It fails to explain that this enables automatic acceptance/dismissal (actual behavior revealed only by schema parameter descriptions), the scope (page vs. session), or what happens when both 'accept' and 'prompt_text' are used together.

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

Conciseness4/5

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

Single efficient sentence with no redundant words. Appropriately front-loaded with the action and resource. Could benefit from a second sentence explaining behavioral scope, but not wasteful as written.

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

Completeness3/5

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

With 100% schema coverage and only two parameters, the description is minimally adequate. However, for a configuration tool with no output schema and no annotations, it lacks critical behavioral context—specifically whether the configuration persists, affects only the next dialog, or is global, and how it interacts with the sibling 'pilot_dialog' tool.

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

Parameters3/5

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

Schema description coverage is 100%, establishing a baseline of 3. The description mentions dialog types (alert/confirm/prompt), which provides minimal contextual hint that 'prompt_text' applies to prompt dialogs specifically, but does not clarify the conditional relationship between parameters or provide example values.

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

Purpose4/5

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

Clear verb ('Configure') and specific resource ('dialogs'), with helpful parenthetical specificity of dialog types (alert/confirm/prompt). However, 'how... are handled' is slightly vague and does not explicitly distinguish from the sibling 'pilot_dialog' tool, which likely directly interacts with dialogs rather than configuring automatic handling behavior.

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

Usage Guidelines2/5

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

Provides no guidance on when to use this tool versus alternatives, particularly the sibling 'pilot_dialog'. Does not mention prerequisites (e.g., a dialog must be present) or whether this applies to the next dialog only or persists for all future dialogs.

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/TacosyHorchata/Pilot'

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