search_files
Find files and folders in a Synology folder and its subfolders by name, pattern, extension, size, or modified date, with filters and a result limit.
Instructions
Search a folder and everything below it for files and folders by name, extension, size or modified date. For what's in one known folder, use list_files; for how much space a folder uses, use get_dir_size, not a search. With no filter, it returns everything under the folder, up to limit. A search that runs out of time returns what it found so far and says so.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Most results to return; the reply says when there are more. | |
| pattern | No | Name to look for: a bare word matches anywhere in the name (`Severance` finds `Severance.S02E10.mkv`); with `*` or `?` it's a wildcard pattern. `*.mkv` is treated as `extension="mkv"`. | |
| size_to | No | Largest size to match, in the same format as `size_from`. | |
| filetype | No | `all` (default: files and folders), `file` or `dir`. | all |
| mtime_to | No | Modified before this time (a file modified at exactly this time doesn't match), in the same formats as `mtime_from`. | |
| extension | No | File extension, without the dot (`mkv`). | |
| recursive | No | Search subfolders too (default true); `false` searches only `folder_path` itself. | |
| size_from | No | Smallest size to match, in bytes or with a unit (`500MiB`, `2GiB`). | |
| mtime_from | No | Modified at or after this time: ISO 8601 (`2026-04-01T12:00:00+00:00`), a date (`2026-04-01`) or Unix epoch seconds; a time with no zone is UTC. | |
| folder_path | Yes | The folder to search (`/video`). | |
| exclude_pattern | No | Wildcard pattern for names to leave out (`*.torrent`), case-insensitive. Applied to the results DSM returns, so a reply can hold fewer than `limit`. |