Scan for duplicates
scan_duplicatesHash every file under a folder into the duplicate-finder index to prepare duplicate detection and cleanup.
Instructions
Run a duplicate scan: hash every file under a folder into the Duplicate Finder's index. Use when: before list_duplicate_groups or trash_duplicates, or after changes. Instead: list_duplicate_scans for past scans; compute_file_checksum for one file. Requires: --mcp-tools duplicates. Behavior: writes index rows, never files. path must be a folder. Each run adds a scan record. Symlinks, the axross trash and secret files are skipped; unchanged files are not hashed again unless rehash. Remote backends use their own checksum (ETag-only ones index nothing). Time limit: 30 min. Returns: {scan_id, root, backend_id, algorithm, files_indexed, status (complete|cancelled|failed), truncated (max_files), complete (no cap, no unreadable folder), unreadable (folder paths)}.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "scan_duplicates"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | The folder (absolute, or relative to the MCP root). Default on the local backend: the MCP root; other backends need it. | |
| rehash | No | Hash every file again, even when size and mtime are unchanged. | |
| backend | No | Backend id from list_backends; omit for the default. | |
| path_b64 | No | path as base64 of its raw bytes, for non-UTF-8 names; replaces path. | |
| algorithm | No | Hash algorithm asked of the backend; a remote backend may answer with its own (e.g. md5), and the rows and the result carry the one used. | sha256 |
| max_files | No | Visit at most this many entries (files and folders together); reaching it stops the walk and sets truncated=true. Default 1,000,000 on the local backend, 100,000 on a remote one. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| root | Yes | ||
| status | Yes | ||
| scan_id | Yes | ||
| complete | Yes | ||
| algorithm | Yes | ||
| truncated | Yes | ||
| backend_id | Yes | ||
| unreadable | No | ||
| files_indexed | Yes |