mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-20 20:52:23 -05:00
[GH-ISSUE #20345] feat: How to access current user (id / email) when a Tool is invoked? #19158
Reference in New Issue
Block a user
Originally created by @meisamhasani on GitHub (Jan 3, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20345
Check Existing Issues
Verify Feature Scope
Problem Description
I am using Open WebUI in a multi-user environment and invoking Tools (custom tool endpoints / MCP tools).
My main question is about user context:
👉 When a user is chatting and a Tool is invoked, how can the tool handler know which user triggered the tool call?
Specifically, I need access to:
User ID
User email (or username)
inside the tool handler (backend service).
Desired Solution you'd like
function
Alternatives Considered
No response
Additional Context
No response
@owui-terminator[bot] commented on GitHub (Jan 3, 2026):
🔍 Similar Issues Found
I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:
#14097 feat: Provide JWT (or similar) to "tools"
by brainboutique • May 20, 2025
#19783 feat: Models Called from API automatically invoke Open-webUI tools, not respond with tool request code
by dwallner0554966 • Dec 05, 2025
#14653 feat: Access to OIDC Access Token for Tools
by Natoandro • Jun 04, 2025
#12610 feat: API: Get a user by email
by mrakgr • Apr 08, 2025
#14142 feat: Expose chat id to tool server calls
by rndmcnlly • May 21, 2025
Show 2 more related issues
#17183 feat: Allow Passing OAuth Token to Tool Calls
by koflerm • Sep 03, 2025
#16881 feat: Can i use custom tools to retrieve users’ chat messages.
by Oscarjia • Aug 25, 2025
💡 Tips:
This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
@Classic298 commented on GitHub (Jan 3, 2026):
See the docs.
@meisamhasani commented on GitHub (Jan 3, 2026):
Thanks for the response.
Could you please point me to the exact section or link in the documentation that explains how user context (such as user id / email) is forwarded or made available when a Tool is invoked?
I’ve reviewed the general Tools documentation, but I couldn’t find anything specific about accessing the current authenticated user inside a tool handler.
A direct link or file/section name would be very helpful.
@Classic298 commented on GitHub (Jan 3, 2026):
@silentoplayz commented on GitHub (Jan 3, 2026):
Check out https://openwebui.com/posts/user_info_retrieval_tool_46dabe49 for reference.