Skip to main content
Glama

Accept or dismiss a page prompt

browser_handle_prompt

Respond to JavaScript alert, confirm, and prompt dialogs by accepting or canceling them, optionally entering prompt text, so blocked pages can continue.

Instructions

Answer the alert / confirm / prompt that a page is waiting on (BiDi browsingContext.handleUserPrompt). accept: true clicks OK, false cancels. userText supplies the answer for a prompt() dialog. Without this the page stays blocked; "no such alert" means nothing is waiting, which is a normal answer.

Input Schema

NameRequiredDescriptionDefault
acceptYestrue = OK, false = Cancel
contextNoTab context id (default: the active tab)
userTextNoText to enter for a prompt() dialog

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations only give readOnlyHint=false; the description adds the real behavioral payload — that the page remains blocked until this is called, that accept maps to OK/Cancel, and that a "no such alert" error is a normal, non-failure outcome. That last point meaningfully prevents the agent from treating a benign error as a fault. It doesn't say what the tool returns or whether dismissing a confirm discards unsaved state.

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?

A single tight block: purpose first, then parameter meaning, then the failure/blocking consequence. Every clause carries information and nothing is redundant.

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 three-parameter dialog tool with no output schema, the description covers purpose, both meaningful parameter behaviors, and the blocking/error semantics. Only the return value and any post-dismiss state effects are left implicit, which is a minor gap here.

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 description coverage is 100%, so accept, context and userText are already documented in the schema. The description restates accept and userText semantics without adding new detail and never mentions the context parameter. Baseline 3 applies when the schema carries the parameter burden.

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 (answer/accept/dismiss) and a specific resource (a page prompt: alert/confirm/prompt), and even names the underlying BiDi command. It is clearly distinguishable from the other browser tools, though it never names its closest sibling browser_list_prompts, which an agent might otherwise reach for to inspect pending dialogs first.

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?

"Without this the page stays blocked" gives a clear condition for when the tool is required, which is exactly the decision an agent needs. It stops short of naming alternatives (e.g. browser_list_prompts to see what is waiting) or of saying when not to call it.

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

Deploy Server

Other Tools