Skip to main content
Glama

Handle dialog

dialog

Accepts or dismisses the currently open JavaScript alert, confirm, prompt, or beforeunload popup in a tab, with optional prompt text before accepting.

Instructions

Accepts or dismisses the JavaScript dialog (alert, confirm, prompt, beforeunload) currently open in the tab.

Input Schema

NameRequiredDescriptionDefault
tabIdNoTab to act on. Defaults to the session target tab (see tab_select).
actionYesWhat to do.
promptTextNoText to enter into a prompt() before accepting.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

Annotations declare readOnlyHint=false and openWorldHint=false, so the mutation profile is already covered. The description adds useful context by naming the dialog types and clarifying that prompt input happens before accepting, but omits behavior on error (no dialog open) and whether the call blocks or waits for a dialog to appear.

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?

A single front-loaded sentence with the action verb first and the qualifying scope ('currently open in the tab') immediately after. Zero filler.

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 three-parameter tool with fully documented schema and no output schema, the description covers what would be returned (nothing, conceptually) and how the action applies. The only material gap is the no-dialog-open case, which is a modest omission.

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; the description adds marginal value by tying the prompt dialog type to the promptText parameter's purpose. It does not restate the tabId default, which the schema already handles.

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?

States a specific verb (accepts or dismisses) and resource (the JavaScript dialog currently open in the tab), and enumerates the dialog types handled (alert, confirm, prompt, beforeunload). No sibling tool covers dialog handling, so it is clearly distinguishable from click/press_key/evaluate.

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 'currently open in the tab' – the agent infers it should call this only when a dialog is blocking the page. However, it never states what to do when no dialog is present, nor points to any alternative (e.g., pressing Enter or navigating away), so guidance is present but incomplete.

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