diff --git a/api/features/versioning/views.py b/api/features/versioning/views.py index 5757de811379..fa9d1ef22e51 100644 --- a/api/features/versioning/views.py +++ b/api/features/versioning/views.py @@ -54,7 +54,7 @@ extensions={ "x-gram": { "name": "get_environment_feature_versions", - "description": "Retrieves version information for a feature flag in a specific environment.", + "description": "Retrieves version information for a feature flag in a specific environment. Use this for environments with v2 feature versioning.", }, }, ), @@ -66,7 +66,7 @@ extensions={ "x-gram": { "name": "create_environment_feature_version", - "description": "Creates a new version for a feature flag in a specific environment.", + "description": "Creates a new version for a feature flag in a specific environment. Use this for environments with v2 feature versioning.", }, }, ), @@ -158,6 +158,15 @@ def perform_destroy(self, instance: EnvironmentFeatureVersion) -> None: super().perform_destroy(instance) + @extend_schema( + tags=["mcp"], + extensions={ + "x-gram": { + "name": "publish_environment_feature_version", + "description": "Publishes a feature version to make it live in the environment. Use this for environments with v2 feature versioning.", + }, + }, + ) @action(detail=True, methods=["POST"]) def publish(self, request: Request, **kwargs) -> Response: # type: ignore[no-untyped-def] ef_version = self.get_object() @@ -217,7 +226,7 @@ def get_queryset(self): # type: ignore[no-untyped-def] extensions={ "x-gram": { "name": "get_environment_feature_version_states", - "description": "Retrieves feature state information for a specific version in an environment.", + "description": "Retrieves feature state information for a specific version in an environment. Use this for environments with v2 feature versioning.", }, }, ), @@ -229,7 +238,7 @@ def get_queryset(self): # type: ignore[no-untyped-def] extensions={ "x-gram": { "name": "create_environment_feature_version_state", - "description": "Creates a new feature state for a specific version in an environment.", + "description": "Creates a new feature state for a specific version in an environment. Use this for environments with v2 feature versioning.", }, }, ), @@ -241,7 +250,7 @@ def get_queryset(self): # type: ignore[no-untyped-def] extensions={ "x-gram": { "name": "update_environment_feature_version_state", - "description": "Updates an existing feature state for a specific version in an environment.", + "description": "Updates an existing feature state for a specific version in an environment. Use this for environments with v2 feature versioning.", }, }, ), diff --git a/api/features/views.py b/api/features/views.py index 152bb5223ff7..bbf252daf76f 100644 --- a/api/features/views.py +++ b/api/features/views.py @@ -795,6 +795,18 @@ def update_feature_state_value(self, value, feature_state): # type: ignore[no-u return feature_state_value +@method_decorator( + name="update", + decorator=extend_schema( + tags=["mcp"], + extensions={ + "x-gram": { + "name": "update_environment_feature_state", + "description": "Updates a feature state in an environment, including enabled status and value. Use this for environments without v2 feature versioning.", + }, + }, + ), +) class EnvironmentFeatureStateViewSet(BaseFeatureStateViewSet): permission_classes = [EnvironmentFeatureStatePermissions]