Skip to main content
Glama

Handle a dialog

browser_handle_dialog
Destructive

Handle a dialog. Takes the session_id from open_browser. 0.1¢ a step that runs.

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

Input Schema

NameRequiredDescriptionDefault
acceptYesWhether to accept the dialog.
promptTextNoThe text of the prompt in case of a prompt dialog.
session_idYesThe session id open_browser returned.

Output Schema

NameRequiredDescriptionDefault
urlNoThe address of the page after the step.
errorNoWhy the step failed, when it failed.
titleNoThe page title.
read_atNoWhen the page was read.
took_msNoHow long the step took.
price_usdNoWhat the step cost, in dollars.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "description": "The page after the step, and what the step cost.",
      +  "properties": {
      +    "error": {
      +      "description": "Why the step failed, when it failed.",
      +      "type": "object"
      +    },
      +    "price_usd": {
      +      "description": "What the step cost, in dollars.",
      +      "type": "number"
      +    },
      +    "read_at": {
      +      "description": "When the page was read.",
      +      "type": "string"
      +    },
      +    "title": {
      +      "description": "The page title.",
      +      "type": "string"
      +    },
      +    "took_ms": {
      +      "description": "How long the step took.",
      +      "type": "integer"
      +    },
      +    "url": {
      +      "description": "The address of the page after the step.",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Added

TDQS

C2.3/5.0
Behavior2/5

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

Annotations already flag destructive=true, openWorld=true, and non-idempotent, so the agent knows this can cause irreversible effects. The description's only added behavioral content is pricing ("0.1¢ a step that runs"), which is cryptic, and it omits crucial facts: which dialog types it covers, what happens on accept vs dismiss, and that a blocking dialog halts other browser calls.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences are front-loaded and waste little space, but "0.1¢ a step that runs" is opaque billing shorthand that consumes a sentence without conveying actionable behavior.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists and all parameters are documented, but for a destructive, open-world browser action the description leaves out the essential mental model: what dialogs are, that they block execution, and the consequences of accept versus promptText. An agent can call it mechanically but cannot reason about when it is safe.

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 100%, so accept and promptText are fully documented in the schema, establishing a baseline of 3. The description only adds the provenance of session_id, which is a small but real addition beyond the schema text.

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

Purpose2/5

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

"Handle a dialog" essentially restates the tool name and title without saying what a dialog is (JS alert/confirm/prompt), whether it accepts or dismisses, or how it differs from siblings like browser_click that may also trigger dialogs. Only the session_id lineage hint adds any specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

It states a prerequisite ("Takes the session_id from open_browser") but gives no when-to-use guidance: nothing about calling this when a dialog blocks page interaction, nor when not to call it, nor alternatives.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.