Skip to content

Commit f8d041e

Browse files
committed
Fix: Propagate app_user_email when a global context already exists
Signed-off-by: Ilia Manolov <iliamanolov@outlook.com>
1 parent cadf02e commit f8d041e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mcpgateway/services/tool_service.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,8 @@ async def invoke_tool(
12221222
gateway_id = getattr(tool, "gateway_id", None)
12231223
if gateway_id and isinstance(gateway_id, str):
12241224
global_context.server_id = gateway_id
1225+
if gateway_id and isinstance(app_user_email, str):
1226+
global_context.user = app_user_email
12251227
else:
12261228
# Create new context (fallback when middleware didn't run)
12271229
request_id = uuid.uuid4().hex

0 commit comments

Comments
 (0)