Skip to main content
Glama
cuongtl1992

Unleash MCP (Feature Toggle)

addFeatureTag

Attach tags to feature flags in Unleash MCP to categorize, manage, and control their behavior effectively within your feature toggle system.

Instructions

Add a tag to a feature flag

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featureNameYesName of the feature to add the tag to
tagTypeYesType of the tag
tagValueYesValue of the tag

Implementation Reference

  • Handler function that executes the addFeatureTag tool logic by calling the underlying addFeatureTag function and formatting success/error responses.
    async function handleAddFeatureTag({ featureName, tagType, tagValue }: { featureName: string, tagType: string, tagValue: string }) { try { // Add tag to the feature const success = await addFeatureTag(featureName, tagType, tagValue); if (!success) { return { content: [{ type: "text", text: JSON.stringify({ success: false, error: `Failed to add tag "${tagType}:${tagValue}" to feature "${featureName}"` }, null, 2) }], isError: true }; } return { content: [{ type: "text", text: JSON.stringify({ success: true, message: `Successfully added tag "${tagType}:${tagValue}" to feature "${featureName}"`, featureName, tagType, tagValue }, null, 2) }] }; } catch (error: any) { return { content: [{ type: "text", text: JSON.stringify({ success: false, error: error.message }, null, 2) }], isError: true }; } }
  • Zod schema defining the input parameters for the addFeatureTag tool: featureName, tagType, tagValue.
    const addFeatureTagParamsSchema = { featureName: z.string().min(1).describe('Name of the feature to add the tag to'), tagType: z.string().min(1).describe('Type of the tag'), tagValue: z.string().min(1).describe('Value of the tag') };
  • src/server.ts:202-207 (registration)
    Registration of the addFeatureTagTool in the MCP server using server.tool().
    server.tool( addFeatureTagTool.name, addFeatureTagTool.description, addFeatureTagTool.paramsSchema as any, addFeatureTagTool.handler as any );
  • Core helper function that performs the HTTP POST to Unleash API to add a tag to a feature flag.
    export async function addFeatureTag( featureName: string, tagType: string, tagValue: string ): Promise<boolean> { try { const payload = { type: tagType, value: tagValue }; await client.post(`/api/admin/features/${featureName}/tags`, payload); logger.info(`Successfully added tag "${tagType}:${tagValue}" to feature "${featureName}"`); return true; } catch (error) { logger.error(`Error adding tag to feature ${featureName}:`, error); return false; } }
  • Tool object definition exporting the addFeatureTag tool with name, description, schema, and handler for use in server registration.
    export const addFeatureTagTool = { name: "addFeatureTag", description: "Add a tag to a feature flag", paramsSchema: addFeatureTagParamsSchema, handler: handleAddFeatureTag };

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