Skip to main content
Glama

对话框应答策略

browser_dialog_respond
Idempotent

Controls what window.confirm and window.prompt return so you can test flows that need confirmation or text input; set accept/cancel values, prompt text, one-time or persistent policy, and reset.

Instructions

Decide what the next (or every following) window.confirm / window.prompt returns, so flows that need confirmation or text input can be tested. Set confirm:true to accept, confirm:false to cancel, prompt:"text" to answer a prompt (prompt with no value returns null). Default is once:true — the policy is consumed by the next dialog; pass once:false to keep it. Pass reset:true to clear the policy.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "browser_dialog_respond"
  }
}

Input Schema

NameRequiredDescriptionDefault
onceNoConsume the policy after the next dialog (default true)
resetNoClear any policy and restore the default (confirm→false, prompt→null)
tabIdNoTab id (default: active tab)
promptNoWhat window.prompt returns as the entered text
confirmNoWhat window.confirm returns (true = accept, false = cancel)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.15.0

TDQS

A3.8/5.0
Behavior3/5

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

The annotations already declare non-read-only, non-destructive, idempotent behavior, so the description's job is to add operational context — and it does: policy consumption semantics, default confirm→false/prompt→null, and null return for an empty prompt. It does not disclose whether setting a policy affects already-open dialogs, or that the policy is stateful and persists across calls (which sits somewhat awkwardly with idempotentHint:true, though not a direct contradiction).

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 tight sentences, front-loaded with the core purpose, then the value mapping, then the once/reset defaults. No filler and no repetition of the title.

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 5-parameter, zero-required, no-output-schema tool with annotations present, the description covers purpose, value mapping, and lifecycle defaults adequately. Minor gaps remain around tabId behavior and interaction with the dialog-inspection sibling, but nothing essential to a correct invocation is absent.

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 the schema already explains every parameter, and the description largely restates it (confirm:true accept, prompt text, once default, reset clears). The one genuinely additive detail beyond the schema is that a prompt with no value returns null. Baseline 3 is appropriate where the schema does the heavy lifting.

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 specific verb and resource: it decides what window.confirm / window.prompt returns for the next or all following dialogs. That is far more precise than a restatement of the name, and the testing intent ('so flows that need confirmation or text input can be tested') is explicit. It stops short of naming the related browser_dialogs sibling, so an agent must infer the division of labor between inspecting dialogs and answering them.

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?

Gives clear context for use and spells out the modes: once:true consumes the policy on the next dialog, once:false keeps it, reset:true clears it. What is missing is any statement of when not to use this versus browser_dialogs, or what happens if a dialog appears with no policy set.

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