Skip to main content
Glama

handle_dialog

Accept or dismiss a blocking JavaScript alert, confirm, prompt, or beforeunload dialog, and supply text to fill a prompt so page interactions can continue.

Instructions

Accept or dismiss a JavaScript alert/confirm/prompt/beforeunload dialog that is blocking the page. promptText fills a prompt().

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": "handle_dialog"
  }
}

Input Schema

NameRequiredDescriptionDefault
tabIdNoTab ID from tabs_list. Omit for the active tab.
acceptNoDefault true.
profileNoChrome profile: folder ("Profile 3"), nickname, or unique display name. Omit to use the current profile.
promptTextNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.1/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden. It discloses the accept/dismiss duality and that promptText feeds a prompt(), but omits that 'accept' defaults to true, what dismissing a beforeunload does to navigation, and what the call returns.

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 short sentences with the blocking behavior front-loaded and the prompt special case appended. Nothing is redundant with the tool name or title.

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?

Reasonable for a 4-parameter, no-output-schema tool, but with zero annotations the definition should say more about the consequences of the accept=true default on destructive confirms and how beforeunload dialogs differ in behavior.

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 covers 75% of parameters, and the description usefully fills the one gap: promptText is undocumented in the schema, and the text explains it supplies the prompt input. It adds no further meaning for tabId, accept, or profile, but those are already documented.

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 concrete verbs (accept or dismiss) and the exact resource (JavaScript alert/confirm/prompt/beforeunload dialogs), plus the effect that matters: the dialog is blocking the page. No sibling tool covers dialog handling, so the agent can route here unambiguously.

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?

The description establishes the triggering condition clearly ('blocking the page'), which tells the agent when this call is necessary. It stops short of explicit when-not guidance or naming what to do instead 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.