Skip to main content
Glama

handle_dialog

Accept, dismiss, or respond to browser alert, confirm, and prompt dialogs during automation; supply prompt text when required.

Instructions

处理页面弹出的 alert/confirm/prompt 对话框。accept=true 确认,false 取消;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": {
      "accept": "<accept>"
    },
    "name": "handle_dialog"
  }
}

Input Schema

NameRequiredDescriptionDefault
acceptYes
promptTextNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.6/5.0
Behavior3/5

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

The description adds real behavioral detail beyond the annotations: accept true confirms vs false cancels, and prompt dialogs take text, which distinguishes the three dialog types' handling. It does not disclose what happens if no dialog is open, whether the call blocks or times out, or whether the dialog message is returned — notable since openWorldHint=true and no output schema exists.

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 compact sentences with no filler: the resource and dialog types come first, then the parameter semantics. Every clause carries information an agent needs.

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?

For a two-parameter, annotation-light tool this is close, but a browser dialog handler is failure-prone and the description says nothing about the no-dialog case or the response. With no output schema, the return value of the call is left entirely undocumented.

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 description coverage is 0%, so the description carries the full burden, and it does: it maps both parameters (accept with its true/false meaning, and promptText as the text supplied to prompt dialogs). Only a minor gap remains — the prompt-text clause never uses the parameter name, and it doesn't say the text is ignored for alert/confirm.

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?

The description names a specific action (handle) and resource (alert/confirm/prompt dialogs), and enumerates the three dialog types it covers, so the agent knows exactly what it operates on. No sibling in the list handles dialogs, so explicit differentiation is unnecessary, but the description also does not state that this is the sole dialog mechanism.

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?

Usage is only implied: an agent infers it should call this when a dialog appears. There is no guidance on ordering relative to siblings (e.g. call before click/type time out on a blocked page), nor on what to do when no dialog is present.

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