deleteStrategy
Remove a strategy configuration from a feature flag in a specified environment to manage and streamline feature toggles effectively.
Instructions
Delete a strategy configuration from a feature flag in the specified environment
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environment | Yes | ||
| featureName | Yes | ||
| projectId | Yes | ||
| strategyId | Yes |
Implementation Reference
- src/tools/delete-strategy.ts:20-69 (handler)Handler function that executes the deleteStrategy tool logic by calling deleteFeatureStrategy and returning formatted success/error responses.export async function handleDeleteStrategy(params: { projectId: string; featureName: string; environment: string; strategyId: string; }) { try { // Delete the feature strategy const result = await deleteFeatureStrategy( params.projectId, params.featureName, params.environment, params.strategyId ); if (!result) { return { content: [{ type: "text", text: JSON.stringify({ success: false, error: `Failed to delete strategy ${params.strategyId} from feature flag '${params.featureName}'` }, null, 2) }], isError: true }; } return { content: [{ type: "text", text: JSON.stringify({ success: true, message: `Successfully deleted strategy ${params.strategyId} from feature flag '${params.featureName}' in environment '${params.environment}'` }, null, 2) }] }; } catch (error: any) { return { content: [{ type: "text", text: JSON.stringify({ success: false, error: error.message }, null, 2) }], isError: true }; } }
- src/tools/delete-strategy.ts:8-15 (schema)Zod schema defining input parameters for the deleteStrategy tool: projectId, featureName, environment, strategyId.export const DeleteStrategyParamsSchema = { projectId: z.string().min(1), featureName: z.string().min(1).max(100).regex(/^[a-z0-9-_.]+$/, { message: "Name must be URL-friendly: use only lowercase, numbers, hyphens, underscores, and periods" }), environment: z.string().min(1), strategyId: z.string().min(1) };
- src/server.ts:129-134 (registration)Registers the deleteStrategy tool with the MCP server using server.tool().server.tool( deleteStrategyTool.name, deleteStrategyTool.description, deleteStrategyTool.paramsSchema as any, deleteStrategyTool.handler as any );
- src/tools/delete-strategy.ts:74-79 (registration)Defines and exports the deleteStrategyTool object containing name, description, schema, and handler.export const deleteStrategyTool = { name: "deleteStrategy", description: "Delete a strategy configuration from a feature flag in the specified environment", paramsSchema: DeleteStrategyParamsSchema, handler: handleDeleteStrategy };