Skip to main content
Glama
Intrect-io

lyra-browser

Official
by Intrect-io

handle_dialog

Control how the next browser action responds to native dialogs (alert, confirm, prompt) by choosing accept or dismiss and optional prompt text.

Instructions

Choose how a native dialog is answered — for the NEXT browser action only.

Dialogs never block the page: every alert, confirm, prompt and beforeunload is answered the moment it appears. Left alone, alerts and beforeunload are accepted and confirm/prompt are dismissed (confirm() returns false, prompt() null). What was raised is listed under dialogs in the reply of the click, type_text or press_key that follows — its message is the page's text, not the user's.

Call this immediately BEFORE the one action that raises the dialog. accept=true (the default) answers yes; accept=false answers no. text is what a prompt() receives — leave it empty to accept the prompt's default value; it is ignored when dismissing.

The answer is for the very next browser-acting call (click, type_text, press_key, hover, scroll, navigate, go_back, reload_page, select_option, set_editor, upload_file, save_draft, publish, tabs switch or close) and only for a dialog that call raises while it runs, on any tab. It ends with that call whether or not a dialog appeared — also when the call was refused, so arm again before retrying — and after about a minute at the latest. A dialog raised later, by a page's own timer or on a page you reach afterwards, is answered by default. Reading (read_page, screenshot, get_url, wait_for ...) does not use it up. Arming again replaces it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNo
acceptNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden — and it does: dialogs never block, all types are auto-answered, the default policy per dialog type (accept alerts/beforeunload, dismiss confirm/prompt with false/null), where the result surfaces ('dialogs' in the triggering call's reply), and the ~1-minute expiry. This is unusually complete behavioral disclosure for a mutation-of-state tool.

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

Conciseness4/5

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

Front-loaded with the core purpose, and most sentences carry needed detail about defaults, scope, and expiry. It is dense and on the long side with some redundancy around expiry/refusal, but no sentence is gratuitous given the tool's subtle semantics.

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

Completeness5/5

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

An output schema exists, so return-value documentation is not required, yet the description still tells the agent where raised dialogs appear. Combined with full coverage of usage timing, defaults, and parameter behavior, an agent has everything needed to arm a dialog correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and it does: accept=true (default) answers yes and false answers no; text is what prompt() receives, empty accepts the prompt default, and it is ignored when dismissing. Both parameters are fully explained beyond the bare schema types.

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?

States a specific verb+resource ('Choose how a native dialog is answered') and immediately scopes it ('for the NEXT browser action only'). It is clearly distinguishable from every sibling, none of which handle dialogs. An agent knows exactly what this tool controls.

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

Usage Guidelines5/5

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

Explicitly says 'Call this immediately BEFORE the one action that raises the dialog,' then enumerates exactly which calls consume the answer (click, type_text, navigate, tabs switch/close, etc.) and which do not (read_page, screenshot, get_url, wait_for). It also states when the arming expires and that re-arming replaces it, leaving nothing to inference.

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