ssh_dir_transfer
Transfer directories between local and remote systems over SSH: upload or download by archiving, sending, and extracting with automatic tar.gz or zip selection.
Instructions
Transfer directories between local and remote systems.
Uses archive-based transfer for efficiency:
Upload: Archives locally, transfers, extracts on remote
Download: Archives on remote, transfers, extracts locally
Archive format is automatically selected based on remote OS:
Linux/macOS: tar.gz
Windows: zip
Where the files end up (check files_location in the result):
upload: the CONTENTS of local_path are placed directly in remote_path (local /x/proj/a.txt -> remote_path/a.txt)
download: the remote folder itself is placed inside local_path (remote /srv/proj/a.txt -> local_path/proj/a.txt)
What it returns (a dictionary): - success: whether the transfer succeeded - operation: 'upload' or 'download' - local_path, remote_path: as given - files_location: the folder where the transferred files now are - archive_format: 'tar.gz' or 'zip' - files_transferred: number of regular files (folders not counted) - directories: number of subfolders (the top folder itself not counted) - payload_bytes: total size of the transferred files - archive_bytes: size of the compressed archive actually sent - bytes_transferred: same as archive_bytes (kept for compatibility)
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 |
|---|---|---|---|
| use_sudo | No | Use sudo for remote operations | |
| direction | Yes | Transfer direction | |
| local_path | Yes | Local directory path | |
| remote_path | Yes | Remote directory path |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||