Skip to main content
Glama

handle_dialog

Set automatic responses to browser alerts, confirms, and prompts before they appear. Accept or dismiss dialogs via CDP even while JavaScript is blocked, and check pending dialog status.

Instructions

Configure handling of alerts, confirms and prompts. Set it BEFORE triggering the action that opens the dialog. Uses CDP Page.javascriptDialogOpening, so it works even while the dialog blocks all JS.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNoText entered into prompt dialogs (with action accept)
actionYesaccept or dismiss the next dialog; get_status: pending ones

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed4 schema fields changedv2.10.5
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / action / description
      Previous value: -"accept: accept the next dialog, dismiss: dismiss/cancel it, get_status: check pending dialogs"New value: +"accept or dismiss the next dialog; get_status: pending ones"
    • changedInput schema / properties / text / description
      Previous value: -"Text to enter in prompt dialogs (only used with action: accept)"New value: +"Text entered into prompt dialogs (with action accept)"
  2. First observedv2.7.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden. It discloses an important implementation trait: it uses CDP Page.javascriptDialogOpening, so it functions even while the dialog blocks all JavaScript. It also warns that configuration must happen before the triggering action. Minor gaps remain, such as whether the handler persists across dialogs, but the provided behavioral detail is meaningful.

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?

Two compact sentences with no filler. The purpose is front-loaded, and the critical timing caveat and CDP mechanism each earn their 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?

For a simple two-parameter tool with full schema coverage, the description is largely complete: it explains purpose, timing, and mechanism. The only missing piece is the exact shape of get_status output, but the action is simple enough that the schema enum plus 'pending ones' provides adequate guidance.

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 the input schema already fully documents both parameters and the enum values. The description adds no additional parameter meaning, which is acceptable given the baseline for fully covered schemas.

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 states a specific verb ('Configure') and a precise resource ('handling of alerts, confirms and prompts'), clearly distinguishing this from the browser-interaction siblings like click, type, and navigate. No other sibling targets JavaScript dialogs.

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

Usage Guidelines4/5

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

The description gives clear usage context: set this before triggering the action that opens the dialog, and it works even when the dialog blocks JS. It does not explicitly enumerate alternatives or exclusions, but no sibling tool handles dialogs, so the routing is still clear.

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

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/Silbercue/public-browser'

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