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
| Name | Required | Description | Default |
|---|---|---|---|
| featureName | Yes | Name of the feature flag to archive | |
| projectId | Yes | ID of the project |
Implementation Reference
- src/tools/archive-flag.ts:19-64 (handler)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 }; } }
- src/tools/archive-flag.ts:11-14 (schema)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 );
- src/tools/archive-flag.ts:69-74 (helper)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 };