ssh_dir_delete
Delete a directory and all its contents recursively with a safety preview: dry_run defaults to True, so pass dry_run=False to actually delete.
Instructions
Delete a directory and all its contents recursively. dry_run DEFAULTS TO
True - calling this with no arguments other than path only PREVIEWS what
would be deleted and deletes NOTHING; you must explicitly pass dry_run=False
to actually delete. Refuses to delete a small set of critical paths outright
(root, home directory, C:\Windows, C:\Users, etc.) regardless of dry_run.
For a simpler non-recursive removal without the preview step, see ssh_dir_remove.
Returns:
{'status': 'success'/'error', 'deleted_items': [str, ...] (paths that were/would be removed, depth-first order)}, plus 'dry_run': True ONLY when
this was a preview (check for this key to tell a preview apart from a real
deletion - it's absent, not False, on actual deletions) and 'error'
(string) on failure. Also fails (with 'error' set) if path is a
recognized critical directory.
Long-running calls: if this takes longer than the server's wait cap (default 50s), it
returns {"status": "in_progress", "handle_id": ...} instead of the result - the work keeps
running. Get the result by polling ssh_cmd_check_status(handle_id=...), which returns this
tool's normal response once finished. Do not call it again meanwhile. Only one such
operation runs at a time; another one started meanwhile fails with a 'busy' error.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Directory path to delete | |
| dry_run | No | Preview deletion without actually deleting | |
| use_sudo | No | Use sudo for the operation |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||