Skip to main content
Glama

browser_handle_dialog

Accept or dismiss pending browser JavaScript dialogs such as alert, confirm, and prompt, optionally entering text for prompt dialogs. Use it to unblock automated browser sessions waiting on a dialog.

Instructions

Accept or dismiss a pending browser JavaScript dialog (alert, confirm, prompt).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

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

Input Schema

NameRequiredDescriptionDefault
acceptYesTrue to accept/OK the dialog, false to dismiss/Cancel.
sessionIdNoOptional target browser session ID. If omitted, uses the currently active session (or auto-launches one).
promptTextNoOptional text to enter for prompt() dialogs.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

B3.3/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden and delivers little: it does not say whether dialogs block other browser actions, whether the call fails or no-ops when no dialog is pending, or whether promptText is ignored for alert/confirm. Only the accept/dismiss semantic is conveyed, which is close to restating the name.

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?

A single front-loaded sentence with no filler; verb, resource, and the dialog types that motivate promptText are packed in without redundancy.

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?

For a three-parameter, annotation-free tool with no output schema, the definition covers the action but leaves out failure behavior and the blocking nature of dialogs. An agent could invoke it correctly but not predict what happens if it is called at the wrong moment.

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%, so each parameter (accept, sessionId, promptText) is already fully documented in the schema, establishing the baseline of 3. The description adds only the parenthetical dialog list, which slightly contextualizes promptText but supplies no format or validation detail beyond the schema.

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

Purpose5/5

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

States a specific verb pair ('accept or dismiss') applied to a specific resource ('pending browser JavaScript dialog') and enumerates the dialog kinds (alert, confirm, prompt). No sibling tool in the catalog handles dialogs, so the purpose is unambiguous to an agent.

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 word 'pending' implies a precondition, but the description never says when an agent should reach for this tool versus e.g. browser_click or browser_snapshot, nor what to do if no dialog is open. There is no explicit when-to-use, when-not-to-use, or alternative routing.

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