Skip to main content
Glama

browser_handle_dialog

browser_handle_dialog

Accept or dismiss a JavaScript alert, confirm, or prompt in a browser tab so page automation can continue. Provide prompt text when accepting a prompt dialog.

Instructions

Accept or dismiss a JavaScript alert, confirm, or prompt. Supply prompt_text when accepting a prompt.

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

Input Schema

NameRequiredDescriptionDefault
actionYes
tab_idYesChrome tab ID.
session_idNoSession that owns the tab. Pass it on every call so the runtime can refuse a tab another session holds.
prompt_textNo
session_nameNoName for this conversation's Chrome tab group, so the tab bar reads as the task instead of a generated id. Sticky: pass it once when the name becomes clear, and again only to rename.

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 already supply the safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=true), so the bar is lower. The description adds the accept-vs-dismiss branching and the prompt-text requirement, but omits the side effect that matters most: accepting a prompt returns a value, and dismissing a confirm typically cancels the pending page action.

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 short sentences, action first, conditional parameter rule second. No filler, nothing that could be moved earlier without harming clarity.

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 five-parameter dialog tool with annotations covering mutability and no output schema, this is close to sufficient. What's missing is the blocking behavior and the fact that the prompt's returned text needs capturing — minor against an otherwise complete 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 60%, and the one gap that matters — the undocumented prompt_text parameter — is exactly what the description explains ('Supply prompt_text when accepting a prompt'), including the condition under which it applies. action's enum and the session/tab parameters are already self-documenting in the schema.

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?

Specific verb pair ('Accept or dismiss') plus a precisely enumerated resource ('JavaScript alert, confirm, or prompt'). No sibling tool handles browser dialogs, so the agent can route to it unambiguously 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 Guidelines3/5

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

'Supply prompt_text when accepting a prompt' gives one concrete conditional rule, which is genuinely useful. However, it never states when this tool must be used (e.g. dialogs block subsequent click/type calls) or what happens if a dialog is left unhandled, so usage is implied rather than spelled out.

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