mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 04:16:03 -05:00
[GH-ISSUE #21770] issue: OpenAPI tool server calls delegated to frontend via event_caller — execution always fails #58230
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @antonioromero-pm on GitHub (Feb 23, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/21770
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.8.3 (Docker,
ghcr.io/open-webui/open-webui:v0.8.3)Ollama Version (if applicable)
No response
Operating System
Windows 11 + WSL2
Browser (if applicable)
Chrome
Confirmation
README.md.Expected Behavior
When the model generates a tool call for an OpenAPI tool server, the backend should make the HTTP request to that tool server directly and return the result to the model.
Actual Behavior
The backend sends a
execute:toolevent to the frontend viaevent_caller:The frontend receives this event but has no server state (it never fetched the tool server specs) and cannot execute the HTTP call. The tool result is
Noneor{"error": "Tool Server Not Found"}.Steps to Reproduce
Requires the schema injection issue (Bug 1) to be resolved first, OR testable by manually ensuring
tool_serversis populated in the request.tool_serverspayload)Logs & Screenshots
No logs to share.
Additional Information
Related issue
#21760 -- these are two halves of the same problem.
Root Cause
response_handlerinmiddleware.pydistinguishes between two tool types via thedirectflag:direct=False— workspace Python tools: executed server-side viatool["callable"]()direct=True— OpenAPI tool server tools: execution delegated to frontend viaevent_callerThe frontend-delegation path assumes the frontend fetched and cached the tool server URL and credentials when it embedded specs into the request payload. Since the frontend never does this for admin-configured OpenAPI servers (Bug 1), it also has no state to execute the call.
The backend already has everything needed to execute the call directly: the server URL, auth headers, and the full OpenAPI spec are all available in
tool["server"]withintools_dict. The utility functionexecute_tool_server()inopen_webui/utils/tools.pyis already capable of making this call and is used by the MCP execution path.Suggested Fix
Replace the
event_callerdelegation in thedirect_toolbranch with a direct backend call using the already-availableexecute_tool_serverutility:Verification
With both this fix and the schema injection fix (Bug 1) applied, the full tool-calling chain works end-to-end:
Initialized 3 tool server(s)— specs cached server-side ✓Patch1: resolved 1 OpenAPI tool server(s) from server-side cache— schemas injected ✓tool_weather_forecast_postwith lat/lon params ✓Patch2: executed tool_weather_forecast_post server-side✓Confirmed working against Open-Meteo API via MCPO with Qwen3 80B using native function calling.
Additional Notes
@tjbck commented on GitHub (Feb 23, 2026):
Intended behaviour, if you require backend to call the server you should be using admin level connections.