Anthropic rejects duplicate websearch tool names When LibreChat web search and…
- User
Anthropic rejects duplicate web_search tool names
When LibreChat web search and Anthropic-native web search are both enabled, expose one
web_searchtool and prefer LibreChat's definition. Do not affect unrelated tools or other providers.Interface
No new public interfaces are introduced.
- Assistant
Now let me check the test file setup to add regression tests:
- Assistant
Let me verify there isn't another merge path (legacy Anthropic client) where the same duplicate could occur:
- Assistant
All checks are done. Let me review the final diff:
- Assistant
The fix is complete. Summary of what was done:
Root cause
When both LibreChat web search (agent tool) and Anthropic-native web search (
web_search: truemodel param) are enabled, two tools namedweb_searchreach the Anthropic API:- LibreChat's tool — loaded via
loadToolsas a structured tool instance (or as atoolDefinitionin event-driven mode), namedweb_search - Anthropic's native tool —
{ type: 'web_search_20250305', name: 'web_search' }emitted by () and surfaced through
- LibreChat's tool — loaded via
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.