Skip to main content
Glama

handle_dialog

Answer blocking browser alert, confirm, and prompt dialogs by accepting or canceling, typing prompt text when needed, and continuing page interaction.

Instructions

Answer the alert, confirm or prompt dialog a page opened, which blocks the page until answered.

accept=true presses OK, false presses Cancel. text is typed into a prompt before pressing OK. Reports a navigation, or what changed on the page, like click.

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": "handle_dialog"
  }
}

Input Schema

NameRequiredDescriptionDefault
textNo
acceptNo
tab_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.0

TDQS

A3.8/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 substantive work: it explains that dialogs block the page, defines accept=true/false as OK/Cancel, defines text as the prompt input order, and discloses the return behavior ('reports a navigation, or what changed on the page, like click'). It omits the failure mode when no dialog is open.

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?

Four short sentences, front-loaded with the core action and its blocking consequence. The final sentence about return value is slightly awkward in phrasing but earns its place by clarifying the result shape.

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

Completeness3/5

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

For a no-annotation, no-output-schema mutation tool, the description covers action, parameter effects and return summary reasonably well. The gaps are the unmentioned tab_id and the undefined behavior when no dialog exists, both of which an agent calling this tool could hit.

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 coverage is 0%, so the description must compensate. It fully explains accept and text, but tab_id – one of three parameters – is never mentioned, so targeting behavior is left undocumented.

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?

Names a specific verb ('Answer') and precise resource ('the alert, confirm or prompt dialog a page opened'), and adds the defining constraint that the dialog blocks the page. No sibling tool in the list handles dialogs, so no differentiation is needed.

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

Usage Guidelines3/5

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

Usage is implied by 'which blocks the page until answered' – the agent infers it should call this when navigation is stuck. There are no explicit when-not conditions, no statement of what happens if no dialog is present, and no mention of when to pass tab_id versus relying on a default.

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