forked from HomeLab/unraid-mcp
fix: even more schema apatations
This commit is contained in:
@@ -85,7 +85,7 @@ QUERIES: dict[str, str] = {
|
||||
""",
|
||||
"services": """
|
||||
query GetServices {
|
||||
services { name online uptime }
|
||||
services { name online uptime { timestamp } }
|
||||
}
|
||||
""",
|
||||
"display": """
|
||||
@@ -103,7 +103,7 @@ QUERIES: dict[str, str] = {
|
||||
""",
|
||||
"owner": """
|
||||
query GetOwner {
|
||||
owner { username avatar url }
|
||||
owner { username avatar }
|
||||
}
|
||||
""",
|
||||
"settings": """
|
||||
@@ -115,7 +115,6 @@ QUERIES: dict[str, str] = {
|
||||
query GetServer {
|
||||
info {
|
||||
os { hostname uptime }
|
||||
versions { unraid }
|
||||
machineId time
|
||||
}
|
||||
array { state }
|
||||
@@ -124,27 +123,22 @@ QUERIES: dict[str, str] = {
|
||||
""",
|
||||
"servers": """
|
||||
query GetServers {
|
||||
servers { id name status description ip port }
|
||||
servers { id name status lanip wanip }
|
||||
}
|
||||
""",
|
||||
"flash": """
|
||||
query GetFlash {
|
||||
flash { id guid product vendor size }
|
||||
flash { id guid product vendor }
|
||||
}
|
||||
""",
|
||||
"ups_devices": """
|
||||
query GetUpsDevices {
|
||||
upsDevices { id model status runtime charge load }
|
||||
upsDevices { id model status name battery { chargeLevel estimatedRuntime health } }
|
||||
}
|
||||
""",
|
||||
"ups_device": """
|
||||
query GetUpsDevice($id: PrefixedID!) {
|
||||
upsDeviceById(id: $id) { id model status runtime charge load voltage frequency temperature }
|
||||
}
|
||||
""",
|
||||
"ups_config": """
|
||||
query GetUpsConfig {
|
||||
upsConfiguration { enabled mode cable driver port }
|
||||
upsDeviceById(id: $id) { id model status name battery { chargeLevel estimatedRuntime health } power {loadPercentage inputVoltage outputVoltage } }
|
||||
}
|
||||
""",
|
||||
}
|
||||
@@ -167,7 +161,6 @@ INFO_ACTIONS = Literal[
|
||||
"flash",
|
||||
"ups_devices",
|
||||
"ups_device",
|
||||
"ups_config",
|
||||
]
|
||||
|
||||
assert set(QUERIES.keys()) == set(INFO_ACTIONS.__args__), (
|
||||
@@ -334,7 +327,6 @@ def register_info_tool(mcp: FastMCP) -> None:
|
||||
flash - Flash drive info
|
||||
ups_devices - List UPS devices
|
||||
ups_device - Single UPS device (requires device_id)
|
||||
ups_config - UPS configuration
|
||||
"""
|
||||
if action not in QUERIES:
|
||||
raise ToolError(f"Invalid action '{action}'. Must be one of: {list(QUERIES.keys())}")
|
||||
@@ -358,7 +350,6 @@ def register_info_tool(mcp: FastMCP) -> None:
|
||||
"owner": "owner",
|
||||
"flash": "flash",
|
||||
"ups_device": "upsDeviceById",
|
||||
"ups_config": "upsConfiguration",
|
||||
}
|
||||
# List-wrapped actions: action -> (GraphQL response key, output key)
|
||||
list_actions: dict[str, tuple[str, str]] = {
|
||||
|
||||
Reference in New Issue
Block a user