Skip to main content
Glama

ie_close_window

Closes a pop-up or modal dialog window in IE mode by hwnd or driver handle, dismissing script alerts and prompts so automation can continue. Leaves the main window, tabs, and system dialogs untouched.

Instructions

Close a pop-up or modal dialog window: target is hwnd: (from ie_windows) or a driver_handle. It will not close the main window (use ie_close) or an attached tab (use ie_detach), and it never touches a system dialog (file, print or security prompt): those are reported as 'system dialog: ask the user'. A script alert/confirm/prompt is closed like its Cancel/OK button (a prompt then returns null). An hwnd target is closed with window.close() over COM, else with WM_CLOSE.

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": {
      "target": "<target>"
    },
    "name": "ie_close_window"
  }
}

Input Schema

NameRequiredDescriptionDefault
targetYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A5/5.0
Behavior5/5

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

No annotations are supplied, so the description carries the full burden and does so: it states what will not be closed, that system dialogs are reported back as 'system dialog: ask the user', that script alert/confirm/prompt are dismissed via their Cancel/OK button, and that a prompt returns null. It even discloses the mechanism (window.close() over COM for hwnd, otherwise WM_CLOSE), which tells the agent how forceful the close is.

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?

Front-loaded with the purpose, then target format, then exclusions, then edge-case semantics. Dense but every clause adds operative information — no filler or restatement of the name.

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?

For a single-parameter, no-output-schema mutation-ish tool, the description covers purpose, accepted target forms, refused targets, dialog-type-specific outcomes, and the underlying close mechanism. Nothing an agent needs to invoke it correctly is missing.

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% (target is an untyped string), so the description must supply the format itself — and it does, giving the exact 'hwnd:<n>' syntax, pointing at ie_windows as the source of that value, and naming driver_handle as the alternative form. That is meaning well beyond the bare schema.

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?

Opens with a specific verb+resource ('Close a pop-up or modal dialog window') and immediately scopes it against the sibling operations it must not be confused with (ie_close for the main window, ie_detach for attached tabs). An agent can pick this tool over its neighbours without opening any schema.

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?

Explicit when-not guidance with named alternatives: not the main window (use ie_close), not an attached tab (use ie_detach), and system dialogs (file/print/security) are explicitly excluded with the instruction to ask the user. The only remaining inference is what counts as a 'pop-up', which the first clause already implies.

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