ssh_dir_remove
Remove a remote directory via SSH immediately; no dry-run, and set recursive to true to delete non-empty directories.
Instructions
Remove a directory on the remote system - this is the simple rmdir/Remove-Item
equivalent. There is NO dry-run/preview mode here (unlike ssh_dir_delete below) -
it acts immediately. If recursive=False (default) and the directory is not
empty, this RAISES an exception rather than returning an error dict - it does not
partially delete anything.
For a safer recursive delete with a preview step, use ssh_dir_delete instead,
which defaults to dry_run=True and returns a graceful {'status': 'error', ...}
on failure instead of raising.
Returns:
{'status': 'success', 'path', 'recursive', 'message', 'connection'} on
success. Raises an exception on failure (non-empty directory with
recursive=False, path not found, permission denied, etc.) rather than
returning an error dict.
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 remove | |
| use_sudo | No | Use sudo for the operation | |
| recursive | No | Remove directory and contents recursively |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||