Skip to main content
Glama

browser_handle_dialog

Set up a handler for the next browser dialog (alert, confirm, prompt) before triggering the action. Choose to accept or provide prompt text.

Instructions

Set up a handler for the next browser dialog (alert/confirm/prompt).

Call this BEFORE the action that triggers the dialog.

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": {
      "accept": "<accept>"
    },
    "name": "browser_handle_dialog"
  }
}

Input Schema

NameRequiredDescriptionDefault
acceptYes
prompt_textNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the burden and does disclose two important traits: the handler targets only the 'next' dialog (implying one-shot scope) and must be registered before the trigger. It does not say what happens to subsequent or unhandled dialogs, whether the browser default fires without a handler, or how registration interacts with the triggering action's own result.

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?

Two short sentences with no filler, and the critical ordering constraint is stated up front in the second line rather than buried. Every sentence carries information; it could be marginally better if the timing constraint led with the tool's purpose.

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?

An output schema exists, so return values need not be explained, and the one-shot timing behavior is covered. The remaining gap is the undocumented parameters, which for a dialog handler determine whether a prompt is accepted, dismissed, or filled correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must explain the two parameters and does not. Neither 'accept' nor 'prompt_text' is mentioned; the meaning of prompt_text (what text is typed into a prompt), its null default, and its interaction with accept for non-prompt dialogs are all left undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb and resource — 'set up a handler' for a 'browser dialog' — and narrows scope to the 'next' dialog, naming the three dialog types (alert/confirm/prompt). No sibling tool covers dialogs, so it is inherently distinguishable, though it offers no explicit routing language.

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 second sentence gives explicit ordering guidance: call this BEFORE the action that triggers the dialog. That is the key usage constraint for this tool. It stops short of when-not-to-use guidance or saying what happens if no handler is registered.

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