{"record":{"id":"2f1da1d019e721c4","repo":"BerriAI/litellm","slug":"toolset-toolset-id-not-found","errorCode":null,"errorMessage":"Toolset '{toolset_id}' not found.","messagePattern":"Toolset '(.+?)' not found\\.","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/management_endpoints/mcp_management_endpoints.py","lineNumber":2898,"sourceCode":"    )\n    @management_endpoint_wrapper\n    async def fetch_mcp_toolset(\n        toolset_id: str,\n        user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),\n    ):\n        prisma_client: Final = get_prisma_client_or_throw(\"Database not connected. Connect a database to your proxy\")\n        # Non-admin keys may only fetch toolsets they've been explicitly granted.\n        if not _user_has_admin_view(user_api_key_dict):\n            op: Final = user_api_key_dict.object_permission\n            granted: Final = getattr(op, \"mcp_toolsets\", None) if op else None\n            if granted is None or toolset_id not in granted:\n                raise HTTPException(\n                    status_code=status.HTTP_403_FORBIDDEN,\n                    detail={\"error\": \"API key does not have access to this toolset.\"},\n                )\n        toolset: Final = await get_mcp_toolset(prisma_client, toolset_id)\n        if toolset is None:\n            raise HTTPException(\n                status_code=status.HTTP_404_NOT_FOUND,\n                detail={\"error\": f\"Toolset '{toolset_id}' not found.\"},\n            )\n        return toolset\n\n    @router.put(\n        \"/toolset\",\n        description=\"Update an existing MCP toolset (admin only)\",\n    )\n    @management_endpoint_wrapper\n    async def edit_mcp_toolset(\n        payload: UpdateMCPToolsetRequest,\n        user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),\n        litellm_changed_by: str | None = Header(None),\n    ):\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(","sourceCodeStart":2880,"sourceCodeEnd":2916,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/mcp_management_endpoints.py#L2880-L2916","documentation":"Lookup/permission failure fetching an MCP toolset: the toolset_id matches no row (HTTP 404 path) — or, for non-admin keys, it was not granted; the message covers the not-found case after the grant check passed.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:2898 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the toolset_id. List toolsets to find the correct id."],"exampleFix":null,"handlingStrategy":"validation","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"}