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 update the merge block:
- Assistant
Now add tests. Insert a new describe block after the GOOGLE_TOOL_CONFLICT test's describe:
- Assistant
All tests pass. Now verify TypeScript and lint:
- Assistant
The 2 failing tests in
summarization.e2e.test.tsfail identically with my changes stashed — they're a pre-existing tokenizer-loading issue in@librechat/agents, unrelated to this fix. All other 838 tests in the agents + anthropic suites pass.Summary
Problem: When an agent on the Anthropic provider had LibreChat web search enabled (agent tool
web_search) and Anthropic-native web search enabled (web_searchmodel param),initializeAgentconcatenated the LibreChat structured tool with the provider-native{ type: 'web_search_20250305', name: 'web_search' }entry from — producing two tools named , which the Anthropic API rejects.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.