(body: dict[str, Any], id_key: str)
| 57 | |
| 58 | |
| 59 | def _normalize_server_config(body: dict[str, Any], id_key: str) -> dict[str, Any]: |
| 60 | config = body.get("config") |
| 61 | if isinstance(config, dict): |
| 62 | normalized = dict(config) |
| 63 | else: |
| 64 | normalized = { |
| 65 | key: value |
| 66 | for key, value in body.items() |
| 67 | if key not in {id_key, "config", "enabled", "mcp_server_config"} |
| 68 | } |
| 69 | if "enabled" in body and "active" not in normalized: |
| 70 | normalized["active"] = body["enabled"] |
| 71 | return normalized |
| 72 | |
| 73 | |
| 74 | def _server_name_from_body(body: dict[str, Any]) -> str: |
no test coverage detected