Identify file types in a folder
scan_file_typesIdentify the content type of every file in a folder and flag misleading extensions. Use it to audit for disguised files, optionally listing only content-extension mismatches.
Instructions
Identify the content type of every file under a folder and flag misleading extensions. Use when: auditing a folder for disguised files (mismatches_only=true). Instead: identify_file_type for one file; walk_tree for names only. Requires: --mcp-tools filetype. Behavior: read-only, breadth-first, name order; symlinks are skipped. max_files, or a folder below subfolder_levels, sets truncated. Unlistable folders and secret files go to unreadable. Time limit: 5 min. Returns: {path, files_scanned, truncated, complete, unreadable (paths), entries: [identify_file_type records]}; mismatches_only lists verdict=mismatch only.
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_file_types"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | The folder to scan (absolute, or relative to the MCP root). Required unless path_b64 is given. | |
| 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. | |
| max_bytes | No | Bytes read from the start of each file for the content check (64 KiB default, at most 1 MiB). | |
| max_files | No | Stop after identifying this many files; more sets truncated=true. | |
| mismatches_only | No | List only files whose content contradicts their extension. | |
| subfolder_levels | No | Subfolder levels, counted from 0: 0 = path's own files, 1 = also its subfolders'. | |
| use_file_command | No | Also run the file(1) command for its description (file_command); local regular files only, ignored on remote backends. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| entries | Yes | ||
| complete | Yes | ||
| truncated | Yes | ||
| unreadable | No | ||
| files_scanned | Yes |