Skip to main content
Glama

vm_close

Closes Windows app windows gracefully and handles save-changes prompts automatically, letting you discard changes, leave prompts open, or kill remaining processes after a timeout.

Instructions

Closes windows the polite way and handles their "save changes?" prompts, instead of vm_window close plus finding and clicking the prompt yourself. Give exactly one of hwnd, pid or process (e.g. "notepad.exe"). Sends WM_CLOSE, then for up to timeout seconds answers any save prompt: discard=True clicks "Don't save" (found by AutomationId, so any language); discard=False reports the prompt and leaves it open. After the timeout, kill=True ends the process of windows still open. Returns {closed: [hwnd], dialogs: [{hwnd, title, clicked}], killed: [pid], left: [hwnd]}. Note: killing an app skips its own cleanup, e.g. Notepad restores killed tabs. Windows guests, needs the helper.

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": {
      "vm": "<vm>"
    },
    "name": "vm_close"
  }
}

Input Schema

NameRequiredDescriptionDefault
vmYes
pidNo
hwndNo
killNo
discardNo
processNo
timeoutNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/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 discloses the WM_CLOSE mechanism, the prompt-answering loop bounded by timeout, both discard branches, the kill fallback, and a real side effect (killing skips app cleanup). It also states the platform/prerequisite ('Windows guests, needs the helper').

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-loads the core purpose and alternative, then layers mechanism and return shape. Dense but nearly every clause carries information; the parenthetical AutomationId remark and the nested quote add slight clutter rather than bloat.

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 7-parameter destructive-ish tool with no annotations and no output schema, the description supplies the return shape ({closed, dialogs, killed, left}), behavioral branches, side effects, and prerequisites. Only the 'vm' parameter's meaning is left implicit.

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 0%, so the description must compensate, and it does for the key params: mutual exclusivity of hwnd/pid/process, process example format, discard=True/False outcomes, timeout semantics, and kill behavior. The 'vm' parameter is never explained, leaving one gap.

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 and resource ('Closes windows') and immediately differentiates itself from the sibling path ('instead of vm_window close plus finding and clicking the prompt yourself'). An agent can distinguish this from vm_window without opening schemas.

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?

Explicitly contrasts with the manual alternative (vm_window close + clicking prompts) and constrains selection to exactly one of hwnd, pid or process with a concrete example. No explicit exclusions or when-not-to-use guidance, so not quite a 5.

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