Skip to main content
Glama

browser_dialog

Manage alert, confirm, and prompt dialogs by setting an automatic accept or dismiss policy, checking status, or answering the currently open dialog to unblock page automation.

Instructions

alert/confirm/prompt block the page until answered. action: status shows the policy and the last dialog; mode: accept|dismiss sets a standing policy so future dialogs are answered automatically; action: answer answers the one that is open right now. Default is no policy — on Drishti the app answers dialogs itself, and two answers to one dialog is worse than one.

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_dialog"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoStanding policy for dialogs (accept=OK, dismiss=Cancel, off=leave alone)
acceptNoFor action=answer: true=OK, false=Cancel (default true)
actionNostatus=show policy, set=choose a mode, answer=respond now
promptTextNoText to type into prompt() when accepting

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.5.0

TDQS

A4.6/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 that dialogs are blocking, that a policy is standing versus one-shot, that the default is no policy, and the double-answer hazard. It stops short of saying what happens if `answer` is called with no dialog open, or whether the policy persists across tabs or sessions.

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?

Four compact clauses, with the blocking behavior front-loaded so the agent immediately understands the stakes, and no redundant restatement of the schema. The closing sentence about the no-policy default is short but earns its place by justifying that default.

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 stateful, no-annotation, no-output-schema tool with 4 optional parameters, the description covers the essential decision points and safety hazard. It leaves minor gaps: what `status` actually returns, behavior when `answer` is invoked with nothing open, and policy scope across tabs.

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 adds real meaning the schema does not: it explains which parameter pairs with which action (mode for the standing policy, accept/promptText for answering now) and clarifies the interaction between the standing policy and the one-shot answer.

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?

The description opens with the concrete problem (alert/confirm/prompt block the page) and then enumerates the tool's three modes of operation: `action: status`, `mode: accept|dismiss`, and `action: answer`. This lets an agent distinguish it from generic siblings like browser_act or browser_click without opening the schema.

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?

It states explicitly when to use each action: status to inspect the policy and last dialog, set-mode to establish a standing auto-answer, answer to respond to the currently open dialog. It also gives a when-not-to default ('Default is no policy — on Drishti the app answers dialogs itself') with the reason two answers to one dialog is worse than one.

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