Skip to main content
Glama
cuongtl1992

Unleash MCP (Feature Toggle)

archiveFlag

Archive a specific feature flag within a project using the Unleash MCP server. Manage feature toggles effectively by removing inactive or outdated flags.

Instructions

Archive a feature flag in a specific project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featureNameYesName of the feature flag to archive
projectIdYesID of the project

Implementation Reference

  • The main handler function for the archiveFlag tool. It calls archiveFeatureFlag(projectId, featureName), handles success/error, and returns formatted MCP response.
    export async function handleArchiveFlag({ projectId, featureName }: { projectId: string, featureName: string }) {
      try {
        // Archive the feature flag
        const success = await archiveFeatureFlag(projectId, featureName);
        
        if (!success) {
          return {
            content: [{ 
              type: "text", 
              text: JSON.stringify({ 
                success: false,
                projectId,
                featureName,
                error: `Feature '${featureName}' not found in project '${projectId}' or could not be archived` 
              }, null, 2)
            }],
            isError: true
          };
        }
        
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({ 
              success: true,
              projectId,
              featureName,
              message: `Feature '${featureName}' in project '${projectId}' has been archived successfully`
            }, null, 2)
          }]
        };
      } catch (error: any) {
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({ 
              success: false,
              projectId,
              featureName,
              error: error.message || 'An unknown error occurred'
            }, null, 2)
          }],
          isError: true
        };
      }
    }
  • Zod schema defining the input parameters for the archiveFlag tool: projectId and featureName.
    export const ArchiveFlagParamsSchema = {
      projectId: z.string().describe('ID of the project'),
      featureName: z.string().describe('Name of the feature flag to archive')
    };
  • src/server.ts:157-162 (registration)
    Registers the archiveFlag tool with the MCP server by calling server.tool with the tool's name, description, schema, and handler.
    server.tool(
      archiveFlagTool.name,
      archiveFlagTool.description,
      archiveFlagTool.paramsSchema as any,
      archiveFlagTool.handler as any
    );
  • Tool object that exports the configuration for the archiveFlag tool, used in server registration.
    export const archiveFlagTool = {
      name: "archiveFlag",
      description: "Archive a feature flag in a specific project",
      paramsSchema: ArchiveFlagParamsSchema,
      handler: handleArchiveFlag
    }; 

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