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
    }; 
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action is to 'Add a tag', implying a mutation, but doesn't specify permissions required, whether the tag overwrites existing ones, error handling, or response format. For a mutation tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that directly states the tool's purpose without any fluff or redundancy. It's front-loaded and efficiently communicates the core action, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity as a mutation operation with no annotations and no output schema, the description is inadequate. It doesn't cover behavioral aspects like side effects, error cases, or return values, leaving significant gaps for the agent to infer or handle incorrectly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with clear descriptions for each parameter (featureName, tagType, tagValue). The description adds no additional semantic context beyond what the schema provides, such as examples or constraints. Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add a tag') and the target resource ('to a feature flag'), which is specific and unambiguous. However, it doesn't differentiate from sibling tools like 'getFeatureTags' or 'patchFlag', which might also involve tags, so it doesn't fully distinguish from alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, such as needing an existing feature flag, or compare it to similar tools like 'patchFlag' or 'updateFlag' that might also modify tags. This leaves the agent without context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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