You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "alexandrusoare (via GitHub)" <gi...@apache.org> on 2026/04/30 12:26:19 UTC

Re: [PR] feat(mcp): Add mcp_call_id to tool responses for server log correlation [superset]

alexandrusoare commented on code in PR #39776:
URL: https://github.com/apache/superset/pull/39776#discussion_r3167881589


##########
superset/mcp_service/middleware.py:
##########
@@ -239,11 +240,19 @@ async def on_call_tool(
         )
         tool_name = getattr(context.message, "name", None)
 
+        mcp_call_id = uuid.uuid4().hex[:12]
         start_time = time.time()
         success = False
         try:
             result = await call_next(context)
             success = not self._is_error_response(result)
+            if isinstance(result, ToolResult):
+                existing_meta = result.meta or {}
+                result = ToolResult(
+                    content=result.content,
+                    meta={**existing_meta, "mcp_call_id": mcp_call_id},
+                    structured_content=result.structured_content,
+                )
             return result

Review Comment:
   Taken care of with commit #5e3ca00
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org