Skip to main content
Glama

ui_click_outside

ui_click_outside

Click outside a modal, drawer, or popover panel to close it via its backdrop, targeting a safe point that is not inside the element or a control, and report what was hit.

Instructions

Click just outside the single element matching the selector, the way a user closes a modal, drawer or popover by clicking its backdrop. Picks a point whose topmost element is not inside the target and not a control, and says what it hit. Pass the dialog panel, not the backdrop. Fails if no safe point exists (the element fills the viewport): use ui_press_key with Escape then. Selectors containing "nth=" are positional: call ui_get_page_state again after the page changes before reusing them.

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": {
      "selector": "<selector>"
    },
    "name": "ui_click_outside"
  }
}

Input Schema

NameRequiredDescriptionDefault
selectorYesCSS selector, or the `selector` value of an element from ui_get_page_state, passed unchanged of the modal/panel to click outside of
session_idNoWhich open session to act on, as returned by ui_start_session. Optional with one open session; required when several are open.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the point-selection rule (topmost element must not be inside the target and must not be a control), which is an important safety property since it avoids accidentally activating a nearby control. It also discloses the failure mode and reports what was hit, though the exact return shape is only hinted at ('says what it hit').

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?

Four dense sentences, each carrying operational information: purpose first, then the corrected argument, then the failure path with an alternative tool, then the selector-staleness caveat. Nothing is redundant or decorative.

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?

The tool is simple (two params, no annotations, no output schema) and the description covers intent, argument choice, failure handling, and selector reuse, which is enough to call it correctly. The only shortfall is that the return payload is described only loosely, which matters slightly since no output schema exists to compensate.

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 coverage is 100%, so the baseline is 3, but the description adds real meaning beyond the schema: the selector must identify the panel rather than the backdrop, and values containing 'nth=' are positional and go stale after page changes. Session scoping is left entirely to the schema, which documents it adequately.

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 action (click just outside the matched element) and the user-level intent it emulates (closing a modal, drawer, or popover via backdrop). This clearly separates it from the sibling ui_click, which clicks an element itself, and it names its own fallback (ui_press_key) when the geometry makes it impossible.

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?

Gives explicit when-to-use (dismiss a backdrop-closable overlay), an explicit how (pass the dialog panel, not the backdrop), an explicit failure condition (element fills the viewport) with the named alternative (ui_press_key with Escape), and a re-invocation rule for positional 'nth=' selectors.

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