Skip to main content
Glama
ylin6

Unleash Feature Flag MCP Server

by ylin6

updateFeatureFlag

Modify an existing Unleash feature flag's properties including description, type, status, and data collection settings to control feature rollouts and behavior.

Instructions

Update an existing feature flag

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featureDataYes
featureIdYes
projectIdYes

Implementation Reference

  • The handler function that executes the tool logic: parses input parameters using UpdateFeatureFlagSchema and sends a PUT request to the Unleash API to update the specified feature flag.
    async function updateFeatureFlag( params: z.infer<typeof UpdateFeatureFlagSchema> ) { const { projectId, featureId, featureData } = UpdateFeatureFlagSchema.parse(params); try { const response = await axios.put( `${UNLEASH_API_URL}/api/admin/projects/${projectId}/features/${featureId}`, featureData, { headers: { Authorization: `Bearer ${UNLEASH_AUTH_TOKEN}`, 'Content-Type': 'application/json', }, } ); return response.data; } catch (error) { console.error('Error updating feature flag:', error); throw error; } }
  • Raw Zod shape definition for updateFeatureFlag input parameters, used directly in tool registration.
    const RawUpdateFeatureFlagShape = { projectId: z.string(), featureId: z.string(), featureData: z.object({ description: z.string(), type: z.enum([ 'experiment', 'kill-switch', 'release', 'operational', 'permission', ]), stale: z.boolean(), archived: z.boolean(), impressionData: z.boolean(), }), };
  • Zod schema for updateFeatureFlag parameters, used for input validation/parsing within the handler.
    const UpdateFeatureFlagSchema = z.object(RawUpdateFeatureFlagShape);
  • src/index.ts:51-59 (registration)
    Registers the 'updateFeatureFlag' tool with the MCP server, specifying name, description, raw input schema, and a thin wrapper async handler that invokes the core updateFeatureFlag function and formats the response.
    server.tool( 'updateFeatureFlag', 'Update an existing feature flag', RawUpdateFeatureFlagShape, async (args) => { const data = await updateFeatureFlag(args); return { content: [{ type: 'text', text: JSON.stringify(data) }] }; } );

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/ylin6/unleash-ff-mcp-server'

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