Skip to main content
Glama
cuongtl1992

Unleash MCP (Feature Toggle)

updateFlag

Modify feature flags in Unleash projects to control enabled features. Update properties like status, type, or description to manage feature toggles effectively.

Instructions

Update an existing feature flag in an Unleash project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
archivedNo
descriptionNo
featureNameYes
impressionDataNo
projectIdYes
staleNo
typeNo

Implementation Reference

  • Handler function that executes the updateFlag tool logic: calls updateFeatureFlag helper and formats MCP response.
    export async function handleUpdateFlag(params: {
      projectId: string;
      featureName: string;
      description?: string;
      type?: string;
      impressionData?: boolean;
      archived?: boolean;
      stale?: boolean;
    }) {
      try {
        // Update the feature flag
        const result = await updateFeatureFlag({
          projectId: params.projectId,
          featureName: params.featureName,
          description: params.description,
          type: params.type,
          impressionData: params.impressionData,
          archived: params.archived,
          stale: params.stale
        });
        
        if (!result) {
          return {
            content: [{ 
              type: "text", 
              text: JSON.stringify({ 
                success: false,
                error: `Failed to update feature flag '${params.featureName}'` 
              }, null, 2)
            }],
            isError: true
          };
        }
        
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({ 
              success: true,
              message: `Successfully updated feature flag '${params.featureName}' in project '${params.projectId}'`,
              flag: result
            }, null, 2)
          }]
        };
      } catch (error: any) {
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({ 
              success: false,
              error: error.message 
            }, null, 2)
          }],
          isError: true
        };
      }
    }
  • Zod schema defining input parameters for the updateFlag tool.
    export const UpdateFlagParamsSchema = {
      projectId: z.string().min(1),
      featureName: z.string().min(1).max(100).regex(/^[a-z0-9-_.]+$/, {
        message: "Name must be URL-friendly: use only lowercase, numbers, hyphens, underscores, and periods"
      }),
      description: z.string().optional(),
      type: z.enum(['release', 'experiment', 'operational', 'permission', 'kill-switch']).optional(),
      impressionData: z.boolean().optional(),
      archived: z.boolean().optional(),
      stale: z.boolean().optional()
    };
  • src/server.ts:101-106 (registration)
    Registration of the updateFlag tool with the MCP server using server.tool().
    server.tool(
      updateFlagTool.name,
      updateFlagTool.description,
      updateFlagTool.paramsSchema as any,
      updateFlagTool.handler as any
    );
  • Tool object definition exporting the updateFlag tool with name, description, schema, and handler.
    export const updateFlagTool = {
      name: "updateFlag",
      description: "Update an existing feature flag in an Unleash project",
      paramsSchema: UpdateFlagParamsSchema,
      handler: handleUpdateFlag
    }; 
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Update' implies a mutation operation, the description doesn't address permission requirements, whether changes are reversible, rate limits, error conditions, or what happens when only partial parameters are provided. This leaves significant behavioral gaps for a mutation tool.

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 gets straight to the point with zero wasted words. It's appropriately sized for a basic tool description and front-loads the essential information.

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 7 parameters, 0% schema description coverage, no annotations, and no output schema, the description is severely incomplete. It doesn't address the tool's behavior, parameter meanings, return values, or differentiation from similar tools in the sibling list, leaving the agent with insufficient context for 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?

With 0% schema description coverage for all 7 parameters, the description provides no parameter information beyond what's implied by the tool name. It doesn't explain what fields can be updated, their purposes, or constraints like the 'type' enum values or 'featureName' pattern requirements. The description fails to compensate for the complete lack of schema documentation.

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 verb ('Update') and resource ('an existing feature flag in an Unleash project'), making the purpose immediately understandable. However, it doesn't differentiate this tool from similar siblings like 'patchFlag' or 'archiveFlag', which would require more specific scope information.

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 like 'patchFlag', 'archiveFlag', or 'createFlag'. It mentions updating 'an existing feature flag' but doesn't specify prerequisites, constraints, or when other tools might be more appropriate.

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