BerriAI/litellm · error · ValueError
Search tool '{search_tool_name}' not found in router.search_
Error message
Search tool '{search_tool_name}' not found in router.search_tools What it means
Lookup guard in the search API router: no entry in router.search_tools has a matching search_tool_name, so the router has no search provider configuration to dispatch the query to.
Source
Thrown at litellm/router_utils/search_api_router.py:106
"""
Get all search tools matching the given name.
Args:
router_instance: The Router instance
search_tool_name: Name of the search tool to find
Returns:
List of matching search tool configurations
Raises:
ValueError: If no matching search tools are found
"""
matching_tools: Final = [
tool for tool in router_instance.search_tools if tool.get("search_tool_name") == search_tool_name
]
if not matching_tools:
raise ValueError(f"Search tool '{search_tool_name}' not found in router.search_tools")
return matching_tools
@staticmethod
async def async_search_with_fallbacks(
router_instance: Any,
original_function: Callable,
**kwargs,
):
"""
Helper function to make a search API call through the router with load balancing and fallbacks.
Reuses the router's retry/fallback infrastructure.
Args:
router_instance: The Router instance
original_function: The original litellm.asearch function
**kwargs: Search parameters including search_tool_name, query, etc.
View on GitHub (pinned to 77b7c6c40c)
Solutions
- Register the search tool in router.search_tools or correct the search_tool_name.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/router_utils/search_api_router.py:106 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/75881602408a7452.
Report an issue: GitHub.