Skip to content

Commit 61ca107

Browse files
authored
feat: tagged-v1-endpoints-for-mcp-usage (#7052)
1 parent 1d9b561 commit 61ca107

2 files changed

Lines changed: 26 additions & 5 deletions

File tree

api/features/versioning/views.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
extensions={
5555
"x-gram": {
5656
"name": "get_environment_feature_versions",
57-
"description": "Retrieves version information for a feature flag in a specific environment.",
57+
"description": "Retrieves version information for a feature flag in a specific environment. Use this for environments with v2 feature versioning.",
5858
},
5959
},
6060
),
@@ -66,7 +66,7 @@
6666
extensions={
6767
"x-gram": {
6868
"name": "create_environment_feature_version",
69-
"description": "Creates a new version for a feature flag in a specific environment.",
69+
"description": "Creates a new version for a feature flag in a specific environment. Use this for environments with v2 feature versioning.",
7070
},
7171
},
7272
),
@@ -158,6 +158,15 @@ def perform_destroy(self, instance: EnvironmentFeatureVersion) -> None:
158158

159159
super().perform_destroy(instance)
160160

161+
@extend_schema(
162+
tags=["mcp"],
163+
extensions={
164+
"x-gram": {
165+
"name": "publish_environment_feature_version",
166+
"description": "Publishes a feature version to make it live in the environment. Use this for environments with v2 feature versioning.",
167+
},
168+
},
169+
)
161170
@action(detail=True, methods=["POST"])
162171
def publish(self, request: Request, **kwargs) -> Response: # type: ignore[no-untyped-def]
163172
ef_version = self.get_object()
@@ -217,7 +226,7 @@ def get_queryset(self): # type: ignore[no-untyped-def]
217226
extensions={
218227
"x-gram": {
219228
"name": "get_environment_feature_version_states",
220-
"description": "Retrieves feature state information for a specific version in an environment.",
229+
"description": "Retrieves feature state information for a specific version in an environment. Use this for environments with v2 feature versioning.",
221230
},
222231
},
223232
),
@@ -229,7 +238,7 @@ def get_queryset(self): # type: ignore[no-untyped-def]
229238
extensions={
230239
"x-gram": {
231240
"name": "create_environment_feature_version_state",
232-
"description": "Creates a new feature state for a specific version in an environment.",
241+
"description": "Creates a new feature state for a specific version in an environment. Use this for environments with v2 feature versioning.",
233242
},
234243
},
235244
),
@@ -241,7 +250,7 @@ def get_queryset(self): # type: ignore[no-untyped-def]
241250
extensions={
242251
"x-gram": {
243252
"name": "update_environment_feature_version_state",
244-
"description": "Updates an existing feature state for a specific version in an environment.",
253+
"description": "Updates an existing feature state for a specific version in an environment. Use this for environments with v2 feature versioning.",
245254
},
246255
},
247256
),

api/features/views.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,18 @@ def update_feature_state_value(self, value, feature_state): # type: ignore[no-u
795795
return feature_state_value
796796

797797

798+
@method_decorator(
799+
name="update",
800+
decorator=extend_schema(
801+
tags=["mcp"],
802+
extensions={
803+
"x-gram": {
804+
"name": "update_environment_feature_state",
805+
"description": "Updates a feature state in an environment, including enabled status and value. Use this for environments without v2 feature versioning.",
806+
},
807+
},
808+
),
809+
)
798810
class EnvironmentFeatureStateViewSet(BaseFeatureStateViewSet):
799811
permission_classes = [EnvironmentFeatureStatePermissions]
800812

0 commit comments

Comments
 (0)