Skip to main content
Glama

resolve_leave_dialog

Destructive

Resolve beforeunload leave dialogs by accepting the protocol prompt, or fall back to Enter after approval if protocol handling fails.

Instructions

Resolve an intended beforeunload leave in one bounded workflow: protocol accept twice, return immediately when no dialog exists, then use a lab-only foreground Enter fallback after the normal physical-input approval gate only when protocol handling actually fails. Approval failures expose reason in the result and diagnostics: elicitation_unsupported, declined, timeout, cancelled or error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior5/5

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

Annotations already indicate destructiveHint=true, and the description adds substantial behavioral detail: the two-step accept protocol, the early return when no dialog exists, the lab-only fallback condition (only when protocol handling fails), and the exposed failure reasons (elicitation_unsupported, declined, timeout, cancelled, error). This goes well beyond the annotations and gives the agent a clear model of the tool's actions and outcomes.

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?

The description is a single, information-dense sentence that front-loads the purpose and then details the workflow and failure modes. While complex, it avoids redundancy and every clause adds meaningful information. It is structured logically and not overly verbose.

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?

Given the output schema exists (so return values are covered) and the annotations declare destructiveHint, the description provides sufficient context for an agent to understand when to call the tool and what it does. It covers the main workflow, edge cases (no dialog, fallback), and failure reasons. It does not mention prerequisites like page state or session validity, but these are likely not essential for a bounded workflow. The description is nearly complete for its complexity.

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

Parameters2/5

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

The schema has a single optional parameter, session_id, with default null, and the description does not mention it at all. Schema coverage is 0%, so the description does not compensate. However, since the parameter is optional and may be ignorable, the gap is less severe, but it is still a missing explanation for a parameter that could affect behavior.

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?

The description clearly identifies the tool as resolving an intended beforeunload leave, with a specific workflow: accept protocol twice, return when no dialog exists, and use a fallback Enter key after approval gate fails. It names the exact failure modes and distinguishes itself from generic dialog handling by specifying the beforeunload context, making the purpose unambiguous even without referencing siblings.

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?

The description implies the tool is for beforeunload dialogs and describes when it returns immediately (no dialog) but does not explicitly state when to use this tool versus alternatives like handle_dialog. It lacks an explicit exclusion or comparison, so an agent must infer the intended use from the beforeunload context. This is adequate but not explicit.

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