[GH-ISSUE #20345] feat: How to access current user (id / email) when a Tool is invoked? #19158

Closed
opened 2026-04-20 01:29:53 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @meisamhasani on GitHub (Jan 3, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20345

Check Existing Issues

  • I have searched for all existing open AND closed issues and discussions for similar requests. I have found none that is comparable to my request.

Verify Feature Scope

  • I have read through and understood the scope definition for feature requests in the Issues section. I believe my feature request meets the definition and belongs in the Issues section instead of the Discussions.

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

Originally created by @meisamhasani on GitHub (Jan 3, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/20345 ### Check Existing Issues - [x] I have searched for all existing **open AND closed** issues and discussions for similar requests. I have found none that is comparable to my request. ### Verify Feature Scope - [x] I have read through and understood the scope definition for feature requests in the Issues section. I believe my feature request meets the definition and belongs in the Issues section instead of the Discussions. ### 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_
Author
Owner

@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:

  1. #14097 feat: Provide JWT (or similar) to "tools"
    by brainboutique • May 20, 2025

  2. #19783 feat: Models Called from API automatically invoke Open-webUI tools, not respond with tool request code
    by dwallner0554966 • Dec 05, 2025

  3. #14653 feat: Access to OIDC Access Token for Tools
    by Natoandro • Jun 04, 2025

  4. #12610 feat: API: Get a user by email
    by mrakgr • Apr 08, 2025

  5. #14142 feat: Expose chat id to tool server calls
    by rndmcnlly • May 21, 2025

Show 2 more related issues
  1. #17183 feat: Allow Passing OAuth Token to Tool Calls
    by koflerm • Sep 03, 2025

  2. #16881 feat: Can i use custom tools to retrieve users’ chat messages.
    by Oscarjia • Aug 25, 2025


💡 Tips:

  • If this is a duplicate, please consider closing this issue and adding any additional details to the existing one
  • If you found a solution in any of these issues, please share it here to help others

This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.

<!-- gh-comment-id:3706986095 --> @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: 1. [#14097](https://github.com/open-webui/open-webui/issues/14097) **feat: Provide JWT (or similar) to "tools"** *by brainboutique • May 20, 2025* 2. [#19783](https://github.com/open-webui/open-webui/issues/19783) **feat: Models Called from API automatically invoke Open-webUI tools, not respond with tool request code** *by dwallner0554966 • Dec 05, 2025* 3. [#14653](https://github.com/open-webui/open-webui/issues/14653) **feat: Access to OIDC Access Token for Tools** *by Natoandro • Jun 04, 2025* 4. [#12610](https://github.com/open-webui/open-webui/issues/12610) **feat: API: Get a user by email** *by mrakgr • Apr 08, 2025* 5. [#14142](https://github.com/open-webui/open-webui/issues/14142) **feat: Expose chat id to tool server calls** *by rndmcnlly • May 21, 2025* <details> <summary>Show 2 more related issues</summary> 6. [#17183](https://github.com/open-webui/open-webui/issues/17183) **feat: Allow Passing OAuth Token to Tool Calls** *by koflerm • Sep 03, 2025* 7. [#16881](https://github.com/open-webui/open-webui/issues/16881) **feat: Can i use custom tools to retrieve users’ chat messages.** *by Oscarjia • Aug 25, 2025* </details> --- 💡 **Tips:** - If this is a duplicate, please consider closing this issue and adding any additional details to the existing one - If you found a solution in any of these issues, please share it here to help others *This comment was generated automatically by a bot.* Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
Author
Owner

@Classic298 commented on GitHub (Jan 3, 2026):

See the docs.

<!-- gh-comment-id:3706986798 --> @Classic298 commented on GitHub (Jan 3, 2026): See the docs.
Author
Owner

@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.

<!-- gh-comment-id:3706988296 --> @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.
Author
Owner

@Classic298 commented on GitHub (Jan 3, 2026):

  1. you can use openwebui.com to search community made tools and look how they do it
  2. https://docs.openwebui.com/features/plugin/development/reserved-args
  3. please never open issues to ask a question, especially a question that is answered in the docs
<!-- gh-comment-id:3706992004 --> @Classic298 commented on GitHub (Jan 3, 2026): 1) you can use openwebui.com to search community made tools and look how they do it 2) https://docs.openwebui.com/features/plugin/development/reserved-args 3) please never open issues to ask a question, especially a question that is answered in the docs
Author
Owner

@silentoplayz commented on GitHub (Jan 3, 2026):

Check out https://openwebui.com/posts/user_info_retrieval_tool_46dabe49 for reference.

<!-- gh-comment-id:3707012068 --> @silentoplayz commented on GitHub (Jan 3, 2026): Check out https://openwebui.com/posts/user_info_retrieval_tool_46dabe49 for reference.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#19158