Skip to main content
Glama

dialog

Destructive

Configure how JavaScript alerts, confirms, and prompts are handled before an action triggers them; choose accept or dismiss and supply prompt text when needed.

Instructions

[Agent Browser] Set up handler for JavaScript dialogs (alert, confirm, prompt). Call BEFORE the action that triggers the dialog. Actions: 'accept' or 'dismiss'. For window.prompt(), provide prompt_text to enter a response.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "action": "<action>"
    },
    "name": "dialog"
  }
}

Input Schema

NameRequiredDescriptionDefault
actionYes
prompt_textNo

Output Schema

NameRequiredDescriptionDefault
dataNo
hintsNo
messageNo
successNo
suggestionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and readOnlyHint=false, so the safety profile is documented. The description adds real behavioral context beyond them: this is a setup/pre-registration tool whose effect must precede the triggering action, plus per-dialog-type behavior. It stops short of saying whether the handler persists across multiple dialogs or is scoped to one navigation, which would be valuable.

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?

Three short sentences, each with a distinct job: what the tool is, when to call it, and how to use each parameter. The timing constraint is front-loaded right after the purpose with 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?

The tool is simple on the surface (2 parameters, 1 required), and the description handles purpose, ordering, and both parameters; an output schema exists, so return values need no explanation. The only gap is handler lifetime and scope, minor against an otherwise self-contained definition.

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 0% and the schema gives no enum for 'action', so the description carries the burden: it lists the accepted values ('accept' or 'dismiss') and scopes 'prompt_text' to window.prompt() only. Both parameters are explained, though the description doesn't say what prompt_text defaults to or how it's ignored for alert/confirm.

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 uses a specific verb and resource: 'Set up handler for JavaScript dialogs (alert, confirm, prompt).' The parenthetical enumerates exactly the dialog types covered, so an agent knows this tool is the sole dialog-handling entry point rather than confusing it with click/fill siblings that trigger 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?

It gives explicit timing guidance: 'Call BEFORE the action that triggers the dialog', which tells the agent where in the call sequence this belongs. It doesn't say what happens if it's called after the trigger, or whether the handler is one-shot or persistent, but it is clear about when the tool is in effect.

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