
issue: Tool not found error when using Anthropics internal tools
快速结论:该报错发生在 Open WebUI 通过 LiteLLM 使用 Anthropic Claude 模型时,Claude 在流式响应中返回了工具调用块(tool call blocks),而 Open WebUI 尝试执行这些工具调用但找不到对应工具,导致工具未找到(Tool not found)错误。优先排查是否使用了 Open WebUI 不支持的 Anthropic 原生工具(如 web_search),以及是否使用了 chat completions API 而非 messages API。
问题场景
用户在 Open WebUI 10.1 版本(Ubuntu 26)上,通过 LiteLLM 连接 Anthropic Claude 模型。用户在聊天控制面板中自定义参数 tools,设置为 [{"type": "web_search_20250305", "name": "web_search"}],期望 Claude 在需要时使用内部网页搜索工具。然而,当 Claude 在流式响应中发送工具调用块时,Open WebUI 会尝试执行这些工具调用,但由于工具在 Open WebUI 中未注册而报错 “Tool not found”。该错误导致响应体中出现失败的工具调用残留,使得 Claude 在下一轮交互中返回错误。
报错原文
Tool not found error when using Anthropics internal tools
实际日志中可能包含类似以下结构的工具调用错误信息(基于 Issue 描述和截图推断):
tool call failed: tool not found
Error: Tool not found
原因分析
可能原因:
- Open WebUI 目前不支持通过 server side tool calls via chat completions 处理 Anthropic 的原生工具。Open WebUI 使用 chat completions API,而 Anthropic 的原生工具(如 web_search_20250305)需要 messages API 支持,这在 Open WebUI 中尚未实现。
- 当 Claude 返回工具调用块时,Open WebUI 会尝试执行这些工具调用,但由于工具在 Open WebUI 内部未注册(属于 Anthropic 内部工具,非 Open WebUI 自定义工具),导致 “Tool not found” 错误。
- Issue 作者指出,Open WebUI 在工具不存在时返回一个包含失败工具调用的响应体,而不是中止工具调用并仅记录日志。这种残留的工具调用结果导致 Claude 在下一轮交互中返回错误。
环境排查
- Open WebUI 版本:10.1(确认是否为最新版本,以及是否包含工具调用相关的修复)
- LiteLLM 版本:确认 LiteLLM 配置中是否正确设置了 Anthropic 模型的工具参数
- 模型:Anthropic Claude(如 Claude 3.5 Sonnet 等)
- 连接方式:LiteLLM → Open WebUI(chat completions API)
- 自定义参数:在聊天控制面板中设置的
tools参数值[{"type": "web_search_20250305", "name": "web_search"}]
解决步骤
- 确认工具使用方式:
Open WebUI 目前不支持通过 chat completions API 使用 Anthropic 的内部原生工具(如 web_search)。这些工具需要通过 Anthropic 的 messages API 调用,而 Open WebUI 不支持该 API。因此,如果你需要 Claude 的网页搜索功能,目前无法直接在 Open WebUI 中通过此方式实现。 - 移除自定义 tools 参数(可优先尝试):
如果不需要 Claude 的原生网页搜索工具,请移除聊天控制面板中自定义的tools参数。这可以避免 Open WebUI 尝试执行不存在的工具调用。 - 改用 Open WebUI 内置工具(如可用):
如果需要在 Claude 模型中使用工具功能,可以考虑在 Open WebUI 中配置内置工具(如网页搜索、计算器等),然后在聊天中选择这些工具。Open WebUI 的内置工具采用不同的调用机制,可能兼容。 - 等待上游支持:
关注 Open WebUI 项目对 Anthropic messages API 的支持进展。目前该功能尚未实现(Issue 创建者已确认 server side tool calls via chat completions 根本不受支持)。 - Issue 中的关联问题参考:
参考相关 Issue(#24906、#21663、#20464)中关于 Open WebUI 原生函数调用路径与外部工具兼容性的讨论,了解是否有临时解决方案。
验证方法
执行解决步骤后,重新发起一个需要网页搜索的提问(如 “What is the latest news?”),观察是否仍然出现 “Tool not found” 错误。如果移除了自定义 tools 参数,Claude 应正常返回文本响应,不再触发工具调用。如果仍需工具功能,确保使用 Open WebUI 支持的内置工具而非 Anthropic 原生工具。



