Skip to main content
Glama

dismiss_dialog

Close browser dialog windows during automated Firefox testing or web scraping to continue script execution.

Instructions

Dismiss browser dialog.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler function that acquires Firefox instance and calls dismissDialog(), with specific error handling for no active dialog.
    export async function handleDismissDialog(_args: unknown): Promise<McpToolResponse> {
      try {
        const { getFirefox } = await import('../index.js');
        const firefox = await getFirefox();
    
        try {
          await firefox.dismissDialog();
          return successResponse('✅ Dismissed');
        } catch (error) {
          const errorMsg = (error as Error).message;
    
          // Concise error for no active dialog
          if (errorMsg.includes('no such alert') || errorMsg.includes('No dialog')) {
            throw new Error('No active dialog');
          }
    
          throw error;
        }
      } catch (error) {
        return errorResponse(error as Error);
      }
    }
  • Tool schema definition with name 'dismiss_dialog', description, and empty input schema (no parameters required).
    export const dismissDialogTool = {
      name: 'dismiss_dialog',
      description: 'Dismiss browser dialog.',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    };
  • src/index.ts:142-146 (registration)
    Registration of the dismiss_dialog handler in the central toolHandlers Map used by the MCP Server for tool execution.
    // Utilities
    ['accept_dialog', tools.handleAcceptDialog],
    ['dismiss_dialog', tools.handleDismissDialog],
    ['navigate_history', tools.handleNavigateHistory],
    ['set_viewport_size', tools.handleSetViewportSize],
  • src/index.ts:186-190 (registration)
    Inclusion of dismissDialogTool in the allTools array, which is returned in response to listTools requests.
    // Utilities
    tools.acceptDialogTool,
    tools.dismissDialogTool,
    tools.navigateHistoryTool,
    tools.setViewportSizeTool,
  • Core Firefox PageManagement helper method that uses WebDriver to switch to the alert dialog and dismiss it.
    async dismissDialog(): Promise<void> {
      try {
        const alert = await this.driver.switchTo().alert();
        await alert.dismiss();
      } catch (error) {
        throw new Error(
          `Failed to dismiss dialog: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. 'Dismiss' implies a safe action (likely closing/canceling), but it doesn't disclose behavioral traits like whether it's synchronous, what happens if no dialog exists, error conditions, or side effects. This is a significant gap for a mutation tool with zero annotation coverage.

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

Conciseness5/5

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

The description is a single, efficient sentence: 'Dismiss browser dialog.' It's front-loaded with the core action and target, with zero wasted words. This is appropriately sized for a simple tool.

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

Completeness2/5

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

Given the tool's complexity (likely a mutation with side effects), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'dismiss' entails (e.g., canceling, closing), return values, or error handling. For a browser interaction tool, this leaves critical gaps.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100% (empty schema). The description doesn't need to add parameter semantics, so it meets the baseline of 4 for zero-parameter tools. No additional value is required or provided.

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?

The description 'Dismiss browser dialog' clearly states the action (dismiss) and target (browser dialog). It distinguishes from siblings like accept_dialog (which would confirm instead of dismiss) and close_page (which closes the entire page rather than a dialog). However, it doesn't specify what type of dialog (alert, confirm, prompt) or context, keeping it from a perfect 5.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when a dialog appears, prerequisites (e.g., must have an open dialog), or differentiate from accept_dialog (its direct sibling). Without such context, an agent might misuse it.

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/mozilla/firefox-devtools-mcp'

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