Skip to main content
Glama

browser_handle_dialog

Set how the next browser dialog (alert, confirm, prompt, beforeunload) is handled by accepting or dismissing it, with optional prompt text, before triggering the dialog.

Instructions

Register how the NEXT JavaScript dialog (alert/confirm/prompt/beforeunload) is handled: accept or dismiss, with optional prompt text. Call this before the action that triggers the dialog.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
acceptYesWhether to accept (true) or dismiss (false) the next dialog.
promptTextNoText to enter for a `prompt` dialog when accepting.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/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. It clearly discloses that this is a one-shot registration for the NEXT dialog and explains the two modes (accept/dismiss) with optional prompt text. It does not cover edge cases like multiple dialogs or no dialog appearing, but the core behavior is explicit and unambiguous.

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?

Two sentences with no wasted words. The core action is front-loaded, and the usage instruction is placed immediately after, making the description easy to parse and act on.

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

Completeness4/5

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

For a simple two-parameter tool with no output schema, the description plus the exhaustive schema cover the essential context: what it does and when to call it. Minor edge cases are not addressed, but they are not critical for correct invocation.

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% and both parameters are already well-documented. The description only paraphrases accept and promptText without adding extra semantic value beyond what the schema already provides.

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?

The description states a specific verb ('Register') and resource (JavaScript dialog handling), enumerates the dialog types (alert/confirm/prompt/beforeunload), and clearly distinguishes this from all sibling browser tools, none of which target dialog handling.

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

Usage Guidelines4/5

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

It gives an explicit timing instruction: 'Call this before the action that triggers the dialog.' This clarifies when to use the tool. It does not name alternatives, but no sibling tool serves the same purpose, so the guidance is sufficient.

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