Skip to main content
Glama

Handle dialog

browser_dialog

Acknowledge or dismiss alert, confirm, prompt, and beforeunload dialogs to unfreeze a tab. Accept, cancel, or supply prompt text so browsing continues.

Instructions

Accepts (accept: true) or dismisses (accept: false) an open dialog (alert/confirm/prompt/beforeunload). The tab is frozen while a dialog is open. Usually judge from its content and handle it yourself (accept if it is part of the requested task; close unneeded notices/ads). Ask the user only when it confirms an irreversible action they didn't request (payment, deletion, etc.). beforeunload: accept = leave page (input lost), dismiss = stay. For prompt, text is the input.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabNoTarget tab: number (1, 2…) or ID ("t7"). Use the stable ID when agents share a slot. Required for action tools when there are multiple tabs.
readNoAppend the page after the action (no separate read needed): text=body text, snapshot=snapshot page 1 (with refs), changes=only lines added/removed since your last snapshot (shortest; full page if the page changed)
slotYesBrowser slot 1-30. "3", "slot 3", "browser 3" → 3. If the user gives a port like 14052, subtract 14049.
textNoText for a prompt dialog (used only when accepting)
agentNoYour display name, shown to other agents. Subagents must always set it. Default "claude-68d9".
acceptYestrue = OK, false = cancel
summaryNoOne-line note of what you are doing (e.g. "comparing laptop prices"). Shown in browser_status (not the status line). Omit to keep the previous one.
multiSlotNotrue only when one agent must handle several slots together (e.g. comparing). Normally omit (one agent = one slot; use subagents for the rest)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/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 well: it discloses the frozen-tab state while a dialog is open, that beforeunload accept loses input while dismiss stays, and that text applies only to prompts. It does not say what happens if no dialog is actually open (error vs. no-op) or whether the call blocks until resolution.

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 core accept/dismiss mapping in the first clause, then layers policy and edge cases. Dense but every sentence adds a decision rule; the parenthetical dialog-type list and the beforeunload/prompt sentences are the only slightly compressed spots.

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?

For a dialog-resolution tool with no annotations and no output schema, it covers the dialog types, the ambiguity-resolution policy, and the frozen-tab side effect. It stops short of stating the failure mode when no dialog exists or what the agent will observe after resolution, which is a minor but real gap for an action tool.

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 100%, so the baseline is 3, but the description genuinely adds meaning beyond the schema for two parameters: accept's direction is restated with dialog-type-specific consequences for beforeunload and prompt, and text is scoped to accepting a prompt only. It adds no semantics for slot, tab, read, agent, summary, or multiSlot, which the schema already documents.

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 precise verb pair (accept/dismiss) on a specific resource (an open dialog) and enumerates the four dialog types it covers. An agent can immediately distinguish this from browser_click or browser_press_key, which never resolve native dialogs.

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 decision policy: judge from content and handle it yourself, accept if it is part of the requested task, close unneeded notices/ads, and ask the user only for irreversible actions they did not request. It also names concrete alternatives to escalate to (the user) and case-specific rules for beforeunload and prompt.

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