Skip to main content
Glama
Browser Control MCP Server

Browser Control MCP Server

by lostmind008

handle_dialog

Accept or dismiss JavaScript alert, confirm, and prompt dialogs in a browser tab, and supply text when a prompt requires input.

Instructions

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

Input Schema

NameRequiredDescriptionDefault
tabIdNoTab ID (optional)
acceptYesAccept (true) or dismiss (false) the dialog
promptTextNoText to enter for prompt dialogs

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.1.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden and does not meet it. It says nothing about whether the call blocks, whether it fails when no dialog exists, whether it waits for a dialog to appear, or whether dismissing a confirm is reversible.

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?

One short, front-loaded sentence with no wasted words. It is efficient, though the brevity contributes to the missing behavioral detail rather than being a deliberate trade-off.

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

Completeness2/5

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

For a tool that mutates page state by accepting or dismissing a blocking dialog, with no annotations and no output schema, the description should disclose preconditions and failure modes. It omits everything beyond the dialog-type list, leaving the agent unsure of when the call is valid.

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 (tabId, accept, promptText) is already documented, giving a baseline of 3. The description adds only marginal meaning by linking prompt dialogs to text entry, but it does not say whether promptText is required for prompt dialogs or how accept combines with it.

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?

The description gives a specific verb (handle) plus the resource (JavaScript dialog) and enumerates the three dialog types covered. It is clearly distinguishable from siblings like click or execute_javascript, though it never explicitly contrasts with them.

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?

There is no guidance on when this tool is needed versus simply letting a dialog auto-resolve, no mention that it must be called while a dialog is blocking the page, and no note about what happens if no dialog is present. The agent must infer the trigger condition from the tool name alone.

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