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
| Name | Required | Description | Default |
|---|---|---|---|
| vm | Yes | ||
| pid | No | ||
| hwnd | No | ||
| kill | No | ||
| discard | No | ||
| process | No | ||
| timeout | No |