{"record":{"id":"e88446136f92100e","repo":"BerriAI/litellm","slug":"a-toolset-with-that-name-already-exists","errorCode":null,"errorMessage":"A toolset with that name already exists.","messagePattern":"A toolset with that name already exists\\.","errorType":"http","errorClass":"HTTPException","httpStatus":409,"severity":"error","filePath":"litellm/proxy/management_endpoints/mcp_management_endpoints.py","lineNumber":2931,"sourceCode":"    ):\n        prisma_client: Final = get_prisma_client_or_throw(\"Database not connected. Connect a database to your proxy\")\n        if LitellmUserRoles.PROXY_ADMIN != user_api_key_dict.user_role:\n            raise HTTPException(\n                status_code=status.HTTP_403_FORBIDDEN,\n                detail={\"error\": \"Only proxy admins can update MCP toolsets.\"},\n            )\n        touched_by: Final = (\n            get_audit_log_changed_by(\n                litellm_changed_by=litellm_changed_by,\n                user_api_key_dict=user_api_key_dict,\n                litellm_proxy_admin_name=LITELLM_PROXY_ADMIN_NAME,\n            )\n            or LITELLM_PROXY_ADMIN_NAME\n        )\n        try:\n            result: Final = await update_mcp_toolset(prisma_client, payload, touched_by)\n        except UniqueViolationError:\n            raise HTTPException(\n                status_code=status.HTTP_409_CONFLICT,\n                detail={\n                    \"error\": (\n                        f\"A toolset named '{payload.toolset_name}' already exists.\"\n                        if payload.toolset_name\n                        else \"A toolset with that name already exists.\"\n                    )\n                },\n            )\n        if result is None:\n            raise HTTPException(\n                status_code=status.HTTP_404_NOT_FOUND,\n                detail={\"error\": f\"Toolset '{payload.toolset_id}' not found.\"},\n            )\n        from litellm.proxy._experimental.mcp_server.mcp_server_manager import (\n            global_mcp_server_manager,\n        )\n","sourceCodeStart":2913,"sourceCodeEnd":2949,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/mcp_management_endpoints.py#L2913-L2949","documentation":"Uniqueness guard on toolset update: the DB raised UniqueViolationError because the new toolset_name collides with an existing toolset; converted to HTTP 409. The message is generic when the payload carries no toolset_name.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:2931 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a different toolset name, or update the existing toolset."],"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"}