Skip to main content
Glama

dialog

Set whether to accept or dismiss the next JavaScript confirm, prompt, or beforeunload pop-up before triggering it; optionally enter prompt text.

Instructions

Decide how to answer the next JavaScript dialog (confirm, prompt, beforeunload) before the action that triggers it. Without this, alerts are accepted and confirms/prompts are dismissed; tool results report every dialog.

Input Schema

NameRequiredDescriptionDefault
actionYes
promptTextNoText to enter when accepting a prompt().

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries the burden and does so well: it discloses the default behavior without the tool (alerts accepted, confirms/prompts dismissed) and that results report every dialog. It stops short of explaining what 'accept' means for beforeunload (navigate away) or prompting edge cases.

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 sentences, front-loaded with the core purpose and ordering constraint, with the default-behavior consequence second. No wasted 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?

No annotations and no output schema, so the description must stand alone; it covers purpose, ordering, and defaults well. The remaining gap is per-dialog-type semantics of the action parameter, which an agent may still need to infer.

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 50% — promptText is documented in the schema, action has an enum but no description. The description contextualizes prompt() by naming it, but never clarifies how accept/dismiss map onto each dialog type or when promptText is required, so it only marginally compensates.

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 ('Decide how to answer') and resource ('the next JavaScript dialog'), and enumerates the dialog types (confirm, prompt, beforeunload) it governs. An agent can distinguish this from navigation/click/type siblings without opening the schema.

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?

Gives a clear timing rule — call it 'before the action that triggers it' — which is the key selection condition for this tool. It also implies when it is not needed by describing the default handling, but it does not name an explicit alternative tool or exclusion.

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