Skip to main content
Glama
cuongtl1992

Unleash MCP (Feature Toggle)

validateFeatureName

Check if a feature flag name is valid and available within the Unleash MCP (Feature Toggle) system by entering the desired name and receiving confirmation.

Instructions

Validate if a feature flag name is valid and available for use

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featureNameYesName of the feature flag to validate

Implementation Reference

  • The main handler function for the validateFeatureName tool, which calls the validation logic and formats the MCP response.
    export async function handleValidateFeatureName({ featureName }: { featureName: string }) {
      try {
        // Validate the feature name
        const result = await validateFeatureName(featureName);
        
        if (!result.isValid) {
          return {
            content: [{ 
              type: "text", 
              text: JSON.stringify({ 
                success: false,
                featureName,
                valid: false,
                error: result.error
              }, null, 2)
            }],
            isError: false // This is not a tool error, just a validation result
          };
        }
        
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({ 
              success: true,
              featureName,
              valid: true,
              message: `Feature name '${featureName}' is valid and available for use`
            }, null, 2)
          }]
        };
      } catch (error: any) {
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({ 
              success: false,
              featureName,
              error: error.message || 'An unknown error occurred'
            }, null, 2)
          }],
          isError: true
        };
      }
    }
  • Zod schema defining the input parameters for the validateFeatureName tool.
    export const ValidateFeatureNameParamsSchema = {
      featureName: z.string().describe('Name of the feature flag to validate')
    };
  • src/server.ts:164-169 (registration)
    Registers the validateFeatureName tool with the MCP server.
    server.tool(
      validateFeatureNameTool.name,
      validateFeatureNameTool.description,
      validateFeatureNameTool.paramsSchema as any,
      validateFeatureNameTool.handler as any
    );
  • Core validation logic that interacts with the Unleash API to check feature name validity, used by the tool handler.
    export async function validateFeatureName(featureName: string): Promise<FeatureNameValidationResult> {
      try {
        await client.post('/api/admin/features/validate', { name: featureName });
        logger.info(`Feature name '${featureName}' is valid`);
        return { isValid: true };
      } catch (error: any) {
        logger.error(`Error validating feature name '${featureName}':`, error);
        
        let errorMessage = 'An unknown error occurred during validation';
        
        if (error.response) {
          const { status } = error.response;
          
          if (status === 400) {
            errorMessage = 'Feature name is not URL friendly';
          } else if (status === 409) {
            errorMessage = 'Feature name already exists';
          } else if (status === 415) {
            errorMessage = 'Unsupported media type';
          }
        }
        
        return { 
          isValid: false, 
          error: errorMessage 
        };
      }
    } 
  • Defines and exports the validateFeatureNameTool object for use in server registration.
    export const validateFeatureNameTool = {
      name: "validateFeatureName",
      description: "Validate if a feature flag name is valid and available for use",
      paramsSchema: ValidateFeatureNameParamsSchema,
      handler: handleValidateFeatureName
    }; 
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 tool validates names for validity and availability, implying a read-only check, but doesn't specify what 'valid' means (e.g., format rules), whether it's idempotent, or if it has side effects like rate limits. This is a significant gap for a validation tool with zero annotation coverage.

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 directly states the tool's purpose without redundancy. It's front-loaded and wastes no words, 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 lack of annotations and output schema, the description is incomplete. It doesn't explain what 'valid' entails (e.g., naming conventions), what 'available' means (e.g., uniqueness checks), or what the return values might be (e.g., boolean success/failure or detailed errors). For a validation tool, this leaves critical behavioral aspects unspecified.

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 the parameter 'featureName' documented as 'Name of the feature flag to validate'. The description adds no additional semantic details beyond this, such as examples or constraints not in the schema. With high schema coverage, the baseline score of 3 is appropriate.

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 tool's purpose: 'Validate if a feature flag name is valid and available for use'. It specifies the verb 'validate' and the resource 'feature flag name', making the intent unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'createFlag' or 'getFlag', which might also involve feature flag names.

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 (e.g., before creating a flag), exclusions, or compare it to siblings such as 'createFlag' or 'listFlags'. 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