Skip to main content
Glama

页面对话框记录

browser_dialogs
Destructive

Read and clear intercepted alert, confirm, and prompt dialogs to detect interruptions without stalling automation. Use before clicking controls that trigger confirm/prompt responses.

Instructions

Read (and optionally clear) dialogs the page tried to open — alert / confirm / prompt. Dialogs are intercepted instead of blocking: by default confirm returns false and prompt returns null. Use browser_dialog_respond first to choose what confirm/prompt return, then click the control that triggers them. Use this tool to detect "are you sure?" style interruptions without stalling the automation.

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

Input Schema

NameRequiredDescriptionDefault
clearNoClear the recorded list after reading (default false)
tabIdNoTab id (default: active tab)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.15.0

TDQS

A4.1/5.0
Behavior3/5

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

Adds genuinely useful behavior beyond the annotations: dialogs are intercepted rather than blocking, confirm defaults to false and prompt to null. It also implicitly reconciles destructiveHint=true by noting clearing is opt-in, but it does not say what the recorded entries contain (type, message, timing) or what happens to records when clear=false and the tab navigates.

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?

Three sentences, front-loaded with the action and followed by sequencing and purpose; almost no waste. Slightly dense — the interception/defaults sentence packs three distinct facts — but each sentence earns its place.

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?

With no output schema, the description carries the return-value burden and does explain that it returns a recorded list plus the effective default return values. The remaining gap is the shape of each recorded dialog entry, which an agent must discover by calling it.

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 both parameters (clear, tabId) are already documented with defaults in the schema. The description's 'optionally clear' and 'the page' phrasing restates rather than extends that, so baseline 3 applies.

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 and resource ('Read (and optionally clear) dialogs') and enumerates the dialog kinds (alert / confirm / prompt). It explicitly separates itself from browser_dialog_respond by naming that sibling as the tool used first to set return values.

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

Usage Guidelines5/5

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

Gives an explicit ordering rule: call browser_dialog_respond first, then click the triggering control, then use this tool to read the records. It also names the concrete situation it serves ('detect "are you sure?" style interruptions without stalling the automation'), so an agent knows exactly when this tool applies versus the sibling.

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