[GH-ISSUE #23365] issue: Built-in tools missing from __tools__ in Pipe functions #74567

Closed
opened 2026-05-13 07:20:59 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @olivier-lacroix on GitHub (Apr 3, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23365

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

0.8.10

Operating System

Linux

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation.

Expected Behavior

When using a Pipe function, the __tools__ parameter passed to the pipe method should contain all available tools, including built-in tools (e.g., web_search, image_generation, execute_code) when they are enabled for the model/user.

Actual Behavior

Currently, only user-defined tools (local tools and external tool servers) are populated in __tools__. Built-in tools are completely missing because get_builtin_tools is not called during the preparation of extra_params for Pipes in backend/open_webui/functions.py.

Steps to Reproduce

  1. Create a Pipe function that prints the keys of __tools__:
    def pipe(self, body: dict, __tools__: dict = None, **kwargs):
        print(f"Available tools: {list(__tools__.keys()) if __tools__ else 'None'}")
        return body
    
  2. Enable built-in tools (like Web Search) for the model using this Pipe.
  3. Send a message to the model.
  4. Check the logs/output and observe that built-in tools like search_web are not listed in the __tools__ keys.

Logs & Screenshots

In backend/open_webui/functions.py, the generate_function_chat_completion function only calls get_tools:

    extra_params['__tools__'] = await get_tools(
        request,
        tool_ids,
        user,
        # ...
    )

It should also call get_builtin_tools and merge the results, similar to how it's handled in backend/open_webui/utils/middleware.py.

Additional Information

I've identified that the fix involves:

  1. Importing get_builtin_tools in backend/open_webui/functions.py.
  2. Calling get_builtin_tools(request, {**extra_params, '__event_emitter__': __event_emitter__}, metadata.get('features', {}), models.get(form_data['model'], None)) and merging it into extra_params['__tools__'].
Originally created by @olivier-lacroix on GitHub (Apr 3, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/23365 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version 0.8.10 ### Operating System Linux ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [ ] I am using the latest version of **both** Open WebUI and Ollama. - [ ] I have included the browser console logs. - [ ] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. ### Expected Behavior When using a Pipe function, the `__tools__` parameter passed to the `pipe` method should contain all available tools, including built-in tools (e.g., `web_search`, `image_generation`, `execute_code`) when they are enabled for the model/user. ### Actual Behavior Currently, only user-defined tools (local tools and external tool servers) are populated in `__tools__`. Built-in tools are completely missing because `get_builtin_tools` is not called during the preparation of `extra_params` for Pipes in `backend/open_webui/functions.py`. ### Steps to Reproduce 1. Create a Pipe function that prints the keys of `__tools__`: ```python def pipe(self, body: dict, __tools__: dict = None, **kwargs): print(f"Available tools: {list(__tools__.keys()) if __tools__ else 'None'}") return body ``` 2. Enable built-in tools (like Web Search) for the model using this Pipe. 3. Send a message to the model. 4. Check the logs/output and observe that built-in tools like `search_web` are not listed in the `__tools__` keys. ### Logs & Screenshots In `backend/open_webui/functions.py`, the `generate_function_chat_completion` function only calls `get_tools`: ```python extra_params['__tools__'] = await get_tools( request, tool_ids, user, # ... ) ``` It should also call `get_builtin_tools` and merge the results, similar to how it's handled in `backend/open_webui/utils/middleware.py`. ### Additional Information I've identified that the fix involves: 1. Importing `get_builtin_tools` in `backend/open_webui/functions.py`. 2. Calling `get_builtin_tools(request, {**extra_params, '__event_emitter__': __event_emitter__}, metadata.get('features', {}), models.get(form_data['model'], None))` and merging it into `extra_params['__tools__']`.
GiteaMirror added the bug label 2026-05-13 07:20:59 -05:00
Author
Owner

@D2758695161 commented on GitHub (Apr 7, 2026):

PR Submitted: #23465

I've fixed this issue. The root cause was that generate_function_chat_completion in ackend/open_webui/functions.py only called get_tools() but not get_builtin_tools().

Fix: Added the get_builtin_tools() call and merged results:

\python
builtin_tools = get_builtin_tools(
request,
extra_params,
metadata.get('features', {}),
model_info,
)
for name, tool_dict in builtin_tools.items():
if name not in extra_params['tools']:
extra_params['tools'][name] = tool_dict

PR: https://github.com/open-webui/open-webui/pull/23465

<!-- gh-comment-id:4196029484 --> @D2758695161 commented on GitHub (Apr 7, 2026): ## PR Submitted: #23465 I've fixed this issue. The root cause was that generate_function_chat_completion in ackend/open_webui/functions.py only called get_tools() but not get_builtin_tools(). **Fix:** Added the get_builtin_tools() call and merged results: \\python builtin_tools = get_builtin_tools( request, extra_params, metadata.get('features', {}), model_info, ) for name, tool_dict in builtin_tools.items(): if name not in extra_params['__tools__']: extra_params['__tools__'][name] = tool_dict \ PR: https://github.com/open-webui/open-webui/pull/23465
Author
Owner

@olivier-lacroix commented on GitHub (Apr 7, 2026):

@D2758695161 yes. I already made a PR for that ( https://github.com/owndev/Open-WebUI-Functions/pull/159 )

I think however that we may tackle this differently, as indicated in the PR. for instance, mcp tools are not present either. I propose we use tool_dict to gather all tools, and set __tools__ to that.

<!-- gh-comment-id:4196529464 --> @olivier-lacroix commented on GitHub (Apr 7, 2026): @D2758695161 yes. I already made a PR for that ( https://github.com/owndev/Open-WebUI-Functions/pull/159 ) I think however that we may tackle this differently, as indicated in the PR. for instance, mcp tools are not present either. I propose we use `tool_dict` to gather all tools, and set `__tools__` to that.
Author
Owner

@tjbck commented on GitHub (Apr 8, 2026):

Addressed in dev.

<!-- gh-comment-id:4209482991 --> @tjbck commented on GitHub (Apr 8, 2026): Addressed in dev.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#74567