BerriAI/litellm · error · Exception
Error adding search tool to DB: {e}
Error message
Error adding search tool to DB: {e} What it means
Catch-all from SearchToolRegistry.add: inserting the new search tool row into the SearchTools table (or serializing its params) failed; the original Prisma/serialization exception is embedded in the message.
Source
Thrown at litellm/proxy/search_endpoints/search_tool_registry.py:83
data={
"search_tool_name": search_tool_name,
"litellm_params": litellm_params,
"search_tool_info": search_tool_info,
"created_at": datetime.now(timezone.utc),
"updated_at": datetime.now(timezone.utc),
}
)
# Add search_tool_id to the returned search tool object
search_tool_dict: Final = dict(search_tool)
search_tool_dict["search_tool_id"] = created_search_tool.search_tool_id
search_tool_dict["created_at"] = created_search_tool.created_at.isoformat()
search_tool_dict["updated_at"] = created_search_tool.updated_at.isoformat()
return search_tool_dict
except Exception as e:
verbose_proxy_logger.exception("Error adding search tool to DB: %s", e)
raise Exception(f"Error adding search tool to DB: {e}")
async def delete_search_tool_from_db(self, search_tool_id: str, prisma_client: PrismaClient):
"""
Delete a search tool from the database.
Args:
search_tool_id: ID of search tool to delete
prisma_client: Prisma client instance
Returns:
Dict with success message
"""
try:
# Get search tool before deletion for response
existing_tool: Final = await SearchToolsRepository(prisma_client).table.find_unique(
where={"search_tool_id": search_tool_id}
)
View on GitHub (pinned to 77b7c6c40c)
Solutions
- Check DB connectivity and the error detail; resolve constraint issues and retry the create.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at litellm/proxy/search_endpoints/search_tool_registry.py:83 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/8ccc6900e73391f6.
Report an issue: GitHub.