Skip to main content
Glama
This connector has been deprecated

Handle JavaScript dialog

browser_handle_dialog

Accept or dismiss the JavaScript dialog that is pending on the shared tab. action is accept or dismiss. promptText (max 2000 characters) is sent only when accepting a prompt; on alert or confirm it is ignored and the result includes a warning. With no pending dialog the call returns NO_DIALOG. Two calls at once: the first resolves the dialog and the other returns NO_DIALOG. If nothing resolves the dialog within 30s it is dismissed and History records Dismissed a dialog (timeout). Uses Page.javascriptDialogOpening and Page.handleJavaScriptDialog. Does not click, type, or capture the page.

Input Schema

NameRequiredDescriptionDefault
actionNo
sessionIdYes
promptTextNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: concurrent-call race behavior, the 30s timeout with automatic dismissal recorded in History, warning emission when promptText is ignored, and an explicit statement that it does not click, type, or capture. This is the exact behavioral context an agent needs for a mutating, open-world tool.

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?

Front-loads the action and promptText semantics before edge cases, and each sentence adds a distinct fact. Slightly dense with the CDP method references that add little for an agent.

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

Completeness5/5

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

No output schema exists, and the description supplies the return signals (NO_DIALOG, warning on ignored promptText, timeout recording) so an agent can interpret results. Nothing needed to call it correctly is missing.

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?

Schema coverage is 0%, so the description carries the burden and largely does: it defines the two action values and constrains promptText to accepting prompts with a max length, plus the ignored-with-warning case. Only sessionId is left to obvious inference.

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/dismiss) and resource (the pending JavaScript dialog on the shared tab), scoping it to one dialog. It is clearly distinguishable from sibling tools like browser_click or browser_observe.

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?

Explains when each action applies, that promptText is only meaningful for prompts, and what happens with no pending dialog (NO_DIALOG). It doesn't explicitly name sibling alternatives to use instead, but the triggering condition is unambiguous.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources