Skip to main content
Glama

browser_handle_dialog

Accept or dismiss JavaScript alert, confirm, and prompt dialogs, and dismiss DOM modal overlays or cookie banners that block browser automation.

Instructions

Handle or configure behavior for JavaScript dialogs (alert, confirm, prompt) or dismiss DOM modal overlays and cookie banners.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "browser_handle_dialog"
  }
}

Input Schema

NameRequiredDescriptionDefault
actionNoWhether to accept or dismiss dialog, or dismiss DOM overlays/bannersaccept
prompt_textNoOptional text to enter for window.prompt

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.12.0
    • changedInput schema / properties / action / description
      Previous value: -"Whether to accept or dismiss dialog"New value: +"Whether to accept or dismiss dialog, or dismiss DOM overlays/banners"
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "accept",
      -  "dismiss"
      -]New value: +[
      +  "accept",
      +  "dismiss",
      +  "dismiss_overlays"
      +]
  2. First observedv0.8.0

TDQS

B3.2/5.0
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, yet it says nothing about blocking behavior (does the call wait for a dialog to appear?), error handling when no dialog exists, or whether dismiss_overlays affects persistent page state. The phrase 'configure behavior' suggests configuration capability that the two-parameter schema does not support, which is mildly misleading.

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?

A single front-loaded sentence with zero filler. It is efficient, though the opening verb pair 'Handle or configure' is broader than the tool's actual surface and slightly dilutes the lead.

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 no annotations, no output schema, and only two parameters, the definition should at minimum state what the tool returns or how it behaves when no dialog exists. As written, an agent knows the resource it targets but not the preconditions or outcome of the call.

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 coverage is 100%, so both parameters are fully documented in the schema, setting the baseline at 3. The description names the three dialog types, which loosely maps to the action enum and to prompt_text, but it adds no detail such as 'prompt_text only applies when handling a prompt dialog' or the default behavior of action=accept.

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?

States a specific verb (handle/configure) and the exact resources: JavaScript dialogs (alert, confirm, prompt) and DOM modal overlays/cookie banners. No sibling tool touches dialogs or overlays, so the scope is self-evidently distinct. However, 'configure behavior' hints at a capability the schema does not expose, muddying what the tool actually does.

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

Usage Guidelines3/5

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

Usage is only implied — an agent infers it should call this when a JS dialog appears or a cookie banner needs clearing. There is no explicit trigger condition (e.g. 'use when a navigation blocks on a dialog'), no when-not guidance, and no note about what happens if no dialog is present.

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

Deploy Server

Other Tools