From 2dbcc0ba5f878c41d31400b871a3a7a9b0d37959 Mon Sep 17 00:00:00 2001 From: Marcus van Elst Date: Tue, 14 Apr 2026 06:45:04 +0200 Subject: [PATCH] Add debug_container_response tool for DSM response inspection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Temporary debug tool that returns the raw SYNO.Docker.Container/get response as JSON directly in the MCP tool output — visible in chat without needing to inspect Claude Desktop logs. To be removed once get_container_status is fixed. Co-Authored-By: Claude Sonnet 4.6 --- .../modules/containers.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/mcp_synology_container/modules/containers.py b/src/mcp_synology_container/modules/containers.py index 6e7b8e6..48c6eaf 100644 --- a/src/mcp_synology_container/modules/containers.py +++ b/src/mcp_synology_container/modules/containers.py @@ -108,6 +108,29 @@ def register_containers(mcp: FastMCP, config: AppConfig, client: DsmClient) -> N return "\n".join(lines).rstrip() + @mcp.tool() + async def debug_container_response(container_name: str) -> str: + """TEMPORARY DEBUG TOOL — returns raw SYNO.Docker.Container/get response as JSON. + + Used to inspect the actual DSM response structure so that + get_container_status can be fixed to read the correct fields. + Remove once the real fix is in place. + + Args: + container_name: Name of the container to inspect. + """ + clean_name = _strip_hash_prefix(container_name) + try: + data = await client.request( + "SYNO.Docker.Container", + "get", + params={"name": clean_name}, + ) + except Exception as e: + return f"Error calling SYNO.Docker.Container/get for '{clean_name}': {e}" + + return json.dumps(data, indent=2, default=str) + @mcp.tool() async def get_container_status(container_name: str) -> str: """Get detailed status, uptime, and resource usage of a container.