Skip to main content
Glama
Chrome DevTools Debug MCP Server

Chrome DevTools Debug MCP Server

by m4eba

handle_dialog

Accept or dismiss JavaScript dialogs like alert, confirm, prompt, and beforeunload during browser debugging, with optional text entry for prompt dialogs.

Instructions

Handle a JavaScript dialog (alert, confirm, prompt, beforeunload).

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
acceptYesWhether to accept (true) or dismiss (false) the dialog
promptTextNoText to enter for prompt dialogs

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

C2.9/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 burden and does not disclose key traits: whether the call blocks until a dialog appears, what happens if no dialog is open (error vs no-op), whether accepting a beforeunload navigates, or whether promptText is ignored for non-prompt dialogs. Only the parenthetical list of dialog types adds context beyond 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler and no redundancy against the schema. It is efficient, though the terseness is part of why operational context is missing.

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 two-parameter, no-output-schema tool this is close to adequate, but a dialog-handling tool has important timing and precondition semantics (dialogs block script execution) that an agent needs and that are absent here.

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 the schema already explains both 'accept' and 'promptText' clearly, so the description adds nothing extra. Baseline 3 is appropriate since the schema does the work; a note that promptText only matters for prompt dialogs would have raised this.

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?

States a specific verb+resource ('Handle a JavaScript dialog') and enumerates the four dialog kinds it covers (alert, confirm, prompt, beforeunload), which tells an agent exactly what class of browser event this targets. It does not differentiate itself from siblings, but no sibling obviously overlaps, so the purpose is unambiguous.

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 statement of when to call this versus alternatives, nor the precondition that a dialog must currently be open and blocking the page. The agent must infer that this is a response to a pending dialog rather than a proactive setup call.

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

Deploy Server

Other Tools