Skip to main content
Glama
cuongtl1992

Unleash MCP (Feature Toggle)

enableFlag

Activate a specific feature flag in a designated environment using the Unleash MCP server. Requires project ID, feature name, and environment details for precise control.

Instructions

Enables a feature flag in the specified environment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environmentYes
featureNameYes
projectIdYes

Implementation Reference

  • The handleEnableFlag function that executes the tool's logic: logs the action, calls enableFeatureFlag from Unleash, returns success/error responses in MCP format.
    export async function handleEnableFlag({
      projectId,
      featureName,
      environment
    }: {
      projectId: string;
      featureName: string;
      environment: string;
    }) {
      logger.info(`Enabling feature flag '${featureName}' in environment '${environment}'`, {
        projectId,
        featureName,
        environment
      });
      
      try {
        const result = await enableFeatureFlag(projectId, featureName, environment);
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              success: true,
              message: `Successfully enabled feature flag '${featureName}' in environment '${environment}'`,
              data: result
            }, null, 2)
          }]
        };
      } catch (error: any) {
        // Handle errors from the Unleash API
        const errorMessage = error.response?.data?.message || error.message;
        const status = error.response?.status;
        
        logger.error(`Failed to enable feature flag: ${errorMessage}`, {
          status,
          projectId,
          featureName,
          environment
        });
        
        // Return a structured error response
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              success: false,
              message: `Failed to enable feature flag: ${errorMessage}`,
              status: status || 500
            }, null, 2)
          }],
          isError: true
        };
      }
    }
  • Zod schema defining the input parameters for the enableFlag tool: projectId, featureName, and environment.
    export const EnableFlagParamsSchema = {
      /**
       * The ID of the project containing the feature flag
       */
      projectId: z.string().min(1),
      
      /**
       * The name of the feature flag to enable
       */
      featureName: z.string().min(1),
      
      /**
       * The environment in which to enable the feature flag
       */
      environment: z.string().min(1)
    };
  • Exports the enableFlagTool object containing name, description, schema, and handler references.
    export const enableFlagTool = {
      name: "enableFlag",
      description: "Enables a feature flag in the specified environment",
      paramsSchema: EnableFlagParamsSchema,
      handler: handleEnableFlag
    }; 
  • src/server.ts:209-214 (registration)
    Registers the enableFlag tool with the MCP server using server.tool().
    server.tool(
      enableFlagTool.name,
      enableFlagTool.description,
      enableFlagTool.paramsSchema as any,
      enableFlagTool.handler as any
    );
Behavior2/5

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

With no annotations, the description carries full burden but only states the action without behavioral details. It doesn't disclose permissions needed, side effects (e.g., if enabling affects existing users), rate limits, or error conditions. 'Enables' implies a mutation, but specifics are lacking.

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, efficient sentence that is front-loaded with the core action. There is no wasted verbiage, making it highly concise and well-structured for quick comprehension.

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?

For a mutation tool with 3 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It lacks details on parameters, behavior, outcomes, and differentiation from siblings, leaving significant gaps for an agent to understand proper usage.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but adds no parameter details. It mentions 'specified environment' vaguely, without explaining the three required parameters (projectId, featureName, environment) or their relationships (e.g., hierarchy, formats).

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 ('Enables') and resource ('a feature flag'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'disableFlag' beyond the verb, nor does it specify what 'enabling' entails (e.g., activating for users).

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?

No guidance is provided on when to use this tool versus alternatives like 'disableFlag', 'patchFlag', or 'updateFlag'. The description mentions 'specified environment' but doesn't explain prerequisites or contextual constraints for enabling flags.

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