ssh_dir_list_advanced
List directory contents recursively with full metadata (size, permissions, ownership, modification time) over SSH when bare filenames are not enough.
Instructions
List contents of a directory recursively with full metadata (size, permissions, ownership, modification time) - use this instead of ssh_dir_list_files_basic (which only returns bare filenames, non-recursive) when you need more than just names, or ssh_dir_search_glob when you only need to filter by filename pattern without full metadata (that tool is also faster for large trees).
max_depth uses standard find -maxdepth semantics: max_depth=1 means path
itself plus its immediate children only; omit for unlimited recursion.
On a 'linux'/'flex' connection with a limited BusyBox-style find (no
-printf - check ssh_conn_connect/ssh_conn_host_info's capabilities),
this raises a clear error instead of running. Fallback: ssh_dir_list_files_basic
(non-recursive filenames) plus ssh_file_stat per entry for metadata - both are
SFTP-based and unaffected by this, at the cost of one call per directory level.
Returns:
List of {'path', 'type', 'size_bytes' (int), 'modified_time' (float Unix timestamp), 'permissions' (string, e.g. "755"), 'user', 'group'}. type is
a spelled-out word here ('file'/'directory'/'symlink'/'pipe'/'socket'/
'block'/'character') - note this differs from ssh_dir_search_glob, which
returns single-character type codes ('f'/'d'/'l') for the same concept.
On Windows, permissions is always the literal placeholder "0" (Windows
has no Unix-style permission bits) and group is always "unknown" -
user still reflects the real file owner there.
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 list | |
| use_sudo | No | Use sudo for the operation | |
| max_depth | No | Maximum recursion depth (None for unlimited) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |