{"record":{"id":"8ccc6900e73391f6","repo":"BerriAI/litellm","slug":"error-adding-search-tool-to-db-e","errorCode":null,"errorMessage":"Error adding search tool to DB: {e}","messagePattern":"Error adding search tool to DB: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/proxy/search_endpoints/search_tool_registry.py","lineNumber":83,"sourceCode":"                data={\n                    \"search_tool_name\": search_tool_name,\n                    \"litellm_params\": litellm_params,\n                    \"search_tool_info\": search_tool_info,\n                    \"created_at\": datetime.now(timezone.utc),\n                    \"updated_at\": datetime.now(timezone.utc),\n                }\n            )\n\n            # Add search_tool_id to the returned search tool object\n            search_tool_dict: Final = dict(search_tool)\n            search_tool_dict[\"search_tool_id\"] = created_search_tool.search_tool_id\n            search_tool_dict[\"created_at\"] = created_search_tool.created_at.isoformat()\n            search_tool_dict[\"updated_at\"] = created_search_tool.updated_at.isoformat()\n\n            return search_tool_dict\n        except Exception as e:\n            verbose_proxy_logger.exception(\"Error adding search tool to DB: %s\", e)\n            raise Exception(f\"Error adding search tool to DB: {e}\")\n\n    async def delete_search_tool_from_db(self, search_tool_id: str, prisma_client: PrismaClient):\n        \"\"\"\n        Delete a search tool from the database.\n\n        Args:\n            search_tool_id: ID of search tool to delete\n            prisma_client: Prisma client instance\n\n        Returns:\n            Dict with success message\n        \"\"\"\n        try:\n            # Get search tool before deletion for response\n            existing_tool: Final = await SearchToolsRepository(prisma_client).table.find_unique(\n                where={\"search_tool_id\": search_tool_id}\n            )\n","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/search_endpoints/search_tool_registry.py#L65-L101","documentation":"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.","triggerScenarios":"Thrown at litellm/proxy/search_endpoints/search_tool_registry.py:83 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check DB connectivity and the error detail; resolve constraint issues and retry the create."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}