fix: even more schema apatations

This commit is contained in:
2026-02-28 17:08:23 +01:00
parent 202354bbc1
commit 37013fbd81
8 changed files with 13 additions and 31 deletions

View File

@@ -84,8 +84,8 @@ docker compose down
- **Health Monitoring**: Comprehensive health check tool for system monitoring
- **Real-time Subscriptions**: WebSocket-based live data streaming
### Tool Categories (9 Tools, 70 Actions)
1. **`unraid_info`** (19 actions): overview, array, network, registration, connect, variables, metrics, services, display, config, online, owner, settings, server, servers, flash, ups_devices, ups_device, ups_config
### Tool Categories (9 Tools, 69 Actions)
1. **`unraid_info`** (19 actions): overview, array, network, registration, connect, variables, metrics, services, display, config, online, owner, settings, server, servers, flash, ups_devices, ups_device
2. **`unraid_storage`** (6 actions): shares, disks, disk_details, log_files, logs
3. **`unraid_docker`** (15 actions): list, details, start, stop, restart, pause, unpause, remove, update, update_all, logs, networks, network_details, port_conflicts, check_updates
4. **`unraid_vm`** (9 actions): list, details, start, stop, pause, resume, force_stop, reboot, reset

View File

@@ -218,11 +218,11 @@ UNRAID_VERIFY_SSL=true # true, false, or path to CA bundle
Each tool uses a consolidated `action` parameter to expose multiple operations, reducing context window usage. Destructive actions require `confirm=True`.
### Tool Categories (9 Tools, 70 Actions)
### Tool Categories (9 Tools, 69 Actions)
| Tool | Actions | Description |
|------|---------|-------------|
| **`unraid_info`** | 19 | overview, array, network, registration, connect, variables, metrics, services, display, config, online, owner, settings, server, servers, flash, ups_devices, ups_device, ups_config |
| **`unraid_info`** | 19 | overview, array, network, registration, connect, variables, metrics, services, display, config, online, owner, settings, server, servers, flash, ups_devices, ups_device |
| **`unraid_storage`** | 6 | shares, disks, disk_details, log_files, logs |
| **`unraid_docker`** | 15 | list, details, start, stop, restart, pause, unpause, remove, update, update_all, logs, networks, network_details, port_conflicts, check_updates |
| **`unraid_vm`** | 9 | list, details, start, stop, pause, resume, force_stop, reboot, reset |

View File

@@ -31,7 +31,6 @@ Execute the `unraid_info` MCP tool with action: `$1`
- `metrics` - System metrics (CPU, RAM, disk I/O)
- `ups_devices` - List all UPS devices
- `ups_device` - Get specific UPS device details (requires device_id)
- `ups_config` - UPS configuration
**Ownership:**
- `owner` - Server owner information

View File

@@ -564,7 +564,6 @@ The current MCP server has 10 tools (76 actions) after consolidation. The follow
|--------------|---------------|---------------|
| `list_ups_devices()` | `upsDevices` query | UPS monitoring |
| `get_ups_device(id)` | `upsDeviceById` query | UPS details |
| `get_ups_configuration()` | `upsConfiguration` query | UPS config |
| `configure_ups(config)` | `configureUps` mutation | UPS management |
#### System Metrics (0 tools currently, 1 query + 3 subscriptions)

View File

@@ -1128,7 +1128,6 @@ type ApiKey implements Node {
permissions: JSON
createdAt: String!
description: String
lastUsed: String
}
type ApiKeyMutations {

View File

@@ -142,12 +142,6 @@ class TestInfoQueries:
errors = _validate_operation(schema, QUERIES["ups_device"])
assert not errors, f"ups_device query validation failed: {errors}"
def test_ups_config_query(self, schema: GraphQLSchema) -> None:
from unraid_mcp.tools.info import QUERIES
errors = _validate_operation(schema, QUERIES["ups_config"])
assert not errors, f"ups_config query validation failed: {errors}"
def test_all_info_actions_covered(self, schema: GraphQLSchema) -> None:
"""Ensure every key in QUERIES has a corresponding test."""
from unraid_mcp.tools.info import QUERIES
@@ -156,7 +150,7 @@ class TestInfoQueries:
"overview", "array", "network", "registration", "connect",
"variables", "metrics", "services", "display", "config",
"online", "owner", "settings", "server", "servers",
"flash", "ups_devices", "ups_device", "ups_config",
"flash", "ups_devices", "ups_device",
}
assert set(QUERIES.keys()) == expected_actions

View File

@@ -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]] = {

View File

@@ -16,12 +16,12 @@ from ..core.exceptions import ToolError
QUERIES: dict[str, str] = {
"list": """
query ListApiKeys {
apiKeys { id name roles permissions { resource actions } createdAt lastUsed }
apiKeys { id name roles permissions { resource actions } createdAt }
}
""",
"get": """
query GetApiKey($id: PrefixedID!) {
apiKey(id: $id) { id name roles permissions { resource actions } createdAt lastUsed }
apiKey(id: $id) { id name roles permissions { resource actions } createdAt }
}
""",
}