Skip to main content
Glama
cuongtl1992

Unleash MCP (Feature Toggle)

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
NameRequiredDescriptionDefault
environmentYes
featureNameYes
projectIdYes
strategyIdYes

Implementation Reference

  • 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
        };
      }
    }
  • 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
    );
  • 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
    }; 

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cuongtl1992/unleash-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server