list_files
Lists files and folders directly inside a Synology folder, one level deep, with name pattern filtering, sorting and paging. Use it to browse a directory's contents before searching deeper.
Instructions
List the files and folders directly inside one folder (one level; subfolders' contents aren't listed). To find files anywhere below a folder by name, extension, size or date, use search_files. Folders show no size; for a folder's total, use get_dir_size. DSM sorts folders and files separately: ascending lists folders first, descending files first. A long listing is paged, and the reply says which offset is next.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The folder to list (`/video/TV Shows`). | |
| limit | No | Most items to return; `0` returns them all. | |
| offset | No | Items to skip; a reply with more says which offset is next. | |
| pattern | No | Name filter, case-insensitive: a bare word matches anywhere in the name; with `*` or `?` the whole name must match (`*.mkv`); commas separate alternatives (`*.mkv,*.mp4`). | |
| sort_by | No | `name` (default), `size`, `mtime` (modified), `crtime` (created), `atime` (accessed), `ctime` (changed), `user` (the owner) or `type`. | name |
| filetype | No | `all` (default), `file` or `dir`. | all |
| sort_direction | No | `asc` (default) or `desc`. | asc |