diff --git a/mcp_server/server.py b/mcp_server/server.py index bd87fa3..e531362 100644 --- a/mcp_server/server.py +++ b/mcp_server/server.py @@ -547,7 +547,7 @@ def add_progress_event( topic_id: str | None = None, workstream_id: str | None = None, task_id: str | None = None, - detail: dict | None = None, + detail: dict | str | None = None, ) -> str: """Append a progress event to the log. @@ -557,8 +557,13 @@ def add_progress_event( topic_id: optional topic UUID workstream_id: optional workstream UUID task_id: optional task UUID - detail: optional structured data (JSONB) + detail: optional structured data (JSONB); accepts a dict or a JSON string """ + if isinstance(detail, str): + try: + detail = json.loads(detail) + except (json.JSONDecodeError, ValueError): + detail = {"raw": detail} event = _post("/progress", { "topic_id": topic_id, "workstream_id": workstream_id,