Skip to main content
Glama

Unleash MCP (Feature Toggle)

archive-flag.ts1.88 kB
/** * Archive flag tool for Unleash MCP Server */ import { z } from 'zod'; import { archiveFeatureFlag } from '../unleash/archive-feature-flag.js'; /** * Schema for archiveFlag tool parameters */ export const ArchiveFlagParamsSchema = { projectId: z.string().describe('ID of the project'), featureName: z.string().describe('Name of the feature flag to archive') }; /** * Handler for archiving a feature flag in a project */ 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 }; } } /** * Tool definition for archiveFlag */ export const archiveFlagTool = { name: "archiveFlag", description: "Archive a feature flag in a specific project", paramsSchema: ArchiveFlagParamsSchema, handler: handleArchiveFlag };

Implementation Reference

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