forked from HomeLab/unraid-mcp
fix: even more changes to accommodate older GraphQL schema
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
"""Storage and disk management.
|
||||
|
||||
Provides the `unraid_storage` tool with 6 actions for shares, physical disks,
|
||||
unassigned devices, log files, and log content retrieval.
|
||||
Provides the `unraid_storage` tool with 6 actions for shares, physical disks, log files, and log content retrieval.
|
||||
"""
|
||||
|
||||
from typing import Any, Literal
|
||||
@@ -37,11 +36,6 @@ QUERIES: dict[str, str] = {
|
||||
}
|
||||
}
|
||||
""",
|
||||
"unassigned": """
|
||||
query GetUnassignedDevices {
|
||||
unassignedDevices { id device name size type }
|
||||
}
|
||||
""",
|
||||
"log_files": """
|
||||
query ListLogFiles {
|
||||
logFiles { name path size modifiedAt }
|
||||
@@ -60,7 +54,6 @@ STORAGE_ACTIONS = Literal[
|
||||
"shares",
|
||||
"disks",
|
||||
"disk_details",
|
||||
"unassigned",
|
||||
"log_files",
|
||||
"logs",
|
||||
]
|
||||
@@ -97,7 +90,6 @@ def register_storage_tool(mcp: FastMCP) -> None:
|
||||
shares - List all user shares with capacity info
|
||||
disks - List all physical disks
|
||||
disk_details - Detailed SMART info for a disk (requires disk_id)
|
||||
unassigned - List unassigned devices
|
||||
log_files - List available log files
|
||||
logs - Retrieve log content (requires log_path, optional tail_lines)
|
||||
"""
|
||||
@@ -158,10 +150,6 @@ def register_storage_tool(mcp: FastMCP) -> None:
|
||||
}
|
||||
return {"summary": summary, "details": raw}
|
||||
|
||||
if action == "unassigned":
|
||||
devices = data.get("unassignedDevices", [])
|
||||
return {"devices": list(devices) if isinstance(devices, list) else []}
|
||||
|
||||
if action == "log_files":
|
||||
files = data.get("logFiles", [])
|
||||
return {"log_files": list(files) if isinstance(files, list) else []}
|
||||
|
||||
Reference in New Issue
Block a user