Skip to main content
Glama

browser_handle_dialog

Resolve JavaScript dialogs (alert, confirm, prompt) that block browser tab execution. Accept or dismiss dialogs to unblock scripts and continue automated web interactions.

Instructions

[Disabled] Handle a JavaScript dialog (alert, confirm, prompt) that is blocking all script execution in a tab. JS dialogs (alert(), confirm(), prompt()) freeze the entire page until dismissed — no other browser tools will work while a dialog is open. Use action "accept" to confirm/dismiss alerts, "dismiss" to cancel. For prompt() dialogs, provide promptText with the text to enter before accepting. Common scenario: a tool call times out or errors because a dialog appeared — call this tool to dismiss it, then retry the original action.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabIdYesTab ID of the page with the dialog
actionYesWhether to accept (OK/Yes) or dismiss (Cancel) the dialog
promptTextNoText to enter in prompt() dialogs before accepting. Ignored for alert/confirm.
Behavior4/5

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

With no annotations provided, the description carries the full burden of explaining behavioral traits. It discloses the blocking nature ('freeze the entire page'), interaction constraints with other tools, the [Disabled] status, and how promptText behaves differently across dialog types. Only misses explicit error handling or return value details.

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?

Five sentences cover: (1) purpose, (2) blocking behavior, (3) action semantics, (4) promptText specifics, and (5) usage scenario. Every sentence earns its place with no redundancy. The [Disabled] tag is front-loaded where it belongs.

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?

Given the tool's specific role in unblocking frozen pages and the lack of output schema, the description is complete. It explains the 'why' (blocking dialogs), 'when' (timeouts/errors), and 'how' (accept/dismiss/promptText) sufficiently for an agent to invoke correctly.

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?

Despite 100% schema coverage (baseline 3), the description adds significant semantic value by mapping the 'accept' and 'dismiss' enum values to UI concepts ('OK/Yes' vs 'Cancel') and clarifying that promptText is 'Ignored for alert/confirm' — behavioral context not present in the schema.

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 explicitly states the tool handles JavaScript dialogs (alert, confirm, prompt) and distinguishes it from sibling tools by explaining that 'no other browser tools will work while a dialog is open.' The [Disabled] prefix also immediately signals availability status.

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?

Provides explicit when-to-use guidance ('Common scenario: a tool call times out or errors because a dialog appeared — call this tool to dismiss it, then retry') and clear alternatives (accept vs dismiss with specific mappings to OK/Yes vs Cancel).

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/opentabs-dev/opentabs'

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