feat: add bounded file inventory for media audits

This commit is contained in:
Mikei386 committed 2026-08-24 11:49:12 +02:00
1 parent d90874ed18
commit 4426969d63
12 files changed
+163 -12

No files matched your search

+29
View File
@@ -533,6 +533,35 @@ export const TOOLS: ToolDef[] = [
},
handler: (a) => runStatusHelper("share-inspect", String(a["share"] ?? "")),
},
{
name: "unraid_files_inventory",
description:
"Inventory file and directory names below one exact Unraid share in one bounded read-only call. Use this instead of repeated ls/find calls for media-library audits, missing-episode checks and locating a named collection. It never reads file contents. If name_contains matches a directory, that directory and its descendants are returned; unrelated trees are omitted.",
inputSchema: {
type: "object",
properties: {
share: str("Exact Unraid share name, for example Audiobooks"),
relative_path: str("Optional path below the share; never use /mnt/user or an absolute path"),
name_contains: str("Optional case-insensitive name fragment, for example 'drei'. Matching directories include their descendants"),
max_depth: int("Maximum directory depth below relative_path (1-20, default 10)"),
max_entries: int("Maximum returned entries (1-5000, default 2000)"),
include_files: { type: "boolean", description: "Include files (default true)" },
include_directories: { type: "boolean", description: "Include directories (default true)" },
},
required: ["share"],
additionalProperties: false,
},
handler: (a) => runStatusHelper(
"files-inventory",
String(a["share"] ?? ""),
String(a["relative_path"] ?? ""),
String(a["name_contains"] ?? ""),
String(Math.max(1, Math.min(20, Number(a["max_depth"] ?? 10)))),
String(Math.max(1, Math.min(5000, Number(a["max_entries"] ?? 2000)))),
a["include_files"] === false ? "0" : "1",
a["include_directories"] === false ? "0" : "1",
),
},
{
name: "unraid_system_connection_test",
description: