Skip to main content
Glama

Handle dialog

browser_handle_dialog

Arm answers for alert, confirm, and prompt dialogs before triggering them, or answer an open dialog immediately to unblock the page.

Instructions

Answers an alert/confirm/prompt. A dialog blocks the page until it is answered, so an unanswered one is dismissed automatically rather than stalling the action that opened it. Call this BEFORE the action that triggers a dialog to arm the answer — that is the only way to accept one or supply prompt() text. Called while a dialog is open, it answers that dialog immediately.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
acceptYesTrue to accept, false to dismiss.
sessionIdYesSession id returned by browser_start.
promptTextNoText to enter into a prompt() dialog.
Behavior5/5

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

The description goes well beyond annotations. It discloses the timing behavior (arming vs. immediate), the auto-dismissal mechanic, and the requirement to call before triggering the dialog for prompt text. This is critical operational detail that the annotations (readOnlyHint=false, openWorldHint=true) do not convey. No contradiction with annotations.

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?

The description is concise and front-loaded. The first sentence states the core purpose, the second explains blocking and default behavior, and the third gives precise usage instructions. Every sentence adds value with no redundancy or filler, making it an exemplar of efficient writing.

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

Completeness5/5

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

For a tool with 3 parameters and no output schema, the description covers everything an agent needs to know: how to invoke it, when to call it, what parameters do, and the consequences of not calling it. It also addresses the two distinct operational states. Given the tool's simplicity and the existing schema/annotations, the description is fully complete.

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?

The input schema already has 100% coverage with clear descriptions for each parameter (accept, sessionId, promptText). The description adds a small amount of context by associating promptText with prompt() dialogs, but it does not meaningfully extend parameter semantics beyond the schema. It mostly explains when to use the parameters, which falls under usage guidance. Baseline 3 is appropriate given high schema coverage.

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 clearly states the tool's purpose: it answers JavaScript dialogs (alert/confirm/prompt). This is a specific verb-resource combination that is immediately distinct from sibling tools like browser_click or browser_navigate. The description also adds valuable context about dialog blocking behavior, which fully clarifies what the tool does.

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?

The description provides explicit usage guidance: it explains the two calling modes (before opening a dialog to arm the answer, or while it's open to answer immediately), and explains that an unanswered dialog is dismissed automatically. This clarifies when to use the tool and what happens if you don't, which is comprehensive and removes ambiguity.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hofmeister/web-ui-tester'

If you have feedback or need assistance with the MCP directory API, please join our Discord server