Skip to main content
Glama
ylin6

Unleash Feature Flag MCP Server

by ylin6

updateFeatureFlag

Modify an existing Unleash feature flag's properties including description, type, status, and data collection settings to control feature rollouts and behavior.

Instructions

Update an existing feature flag

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featureDataYes
featureIdYes
projectIdYes

Implementation Reference

  • The handler function that executes the tool logic: parses input parameters using UpdateFeatureFlagSchema and sends a PUT request to the Unleash API to update the specified feature flag.
    async function updateFeatureFlag(
      params: z.infer<typeof UpdateFeatureFlagSchema>
    ) {
      const { projectId, featureId, featureData } =
        UpdateFeatureFlagSchema.parse(params);
      try {
        const response = await axios.put(
          `${UNLEASH_API_URL}/api/admin/projects/${projectId}/features/${featureId}`,
          featureData,
          {
            headers: {
              Authorization: `Bearer ${UNLEASH_AUTH_TOKEN}`,
              'Content-Type': 'application/json',
            },
          }
        );
        return response.data;
      } catch (error) {
        console.error('Error updating feature flag:', error);
        throw error;
      }
    }
  • Raw Zod shape definition for updateFeatureFlag input parameters, used directly in tool registration.
    const RawUpdateFeatureFlagShape = {
      projectId: z.string(),
      featureId: z.string(),
      featureData: z.object({
        description: z.string(),
        type: z.enum([
          'experiment',
          'kill-switch',
          'release',
          'operational',
          'permission',
        ]),
        stale: z.boolean(),
        archived: z.boolean(),
        impressionData: z.boolean(),
      }),
    };
  • Zod schema for updateFeatureFlag parameters, used for input validation/parsing within the handler.
    const UpdateFeatureFlagSchema = z.object(RawUpdateFeatureFlagShape);
  • src/index.ts:51-59 (registration)
    Registers the 'updateFeatureFlag' tool with the MCP server, specifying name, description, raw input schema, and a thin wrapper async handler that invokes the core updateFeatureFlag function and formats the response.
    server.tool(
      'updateFeatureFlag',
      'Update an existing feature flag',
      RawUpdateFeatureFlagShape,
      async (args) => {
        const data = await updateFeatureFlag(args);
        return { content: [{ type: 'text', text: JSON.stringify(data) }] };
      }
    );
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 this is an update operation, implying mutation, but doesn't disclose critical details like required permissions, whether changes are reversible, potential side effects, or response format. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly. No extraneous words or redundant information are present, which is ideal for conciseness.

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 (3 parameters with nested objects, mutation operation, no annotations, and no output schema), the description is inadequate. It doesn't cover parameter meanings, behavioral traits, or usage context, leaving the agent to guess based on schema structure alone. For a tool that modifies data, this lack of completeness could lead to incorrect invocations.

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%, meaning none of the 3 parameters (projectId, featureId, featureData) or nested properties are documented in the schema. The description adds no parameter information beyond implying an update occurs, failing to compensate for the coverage gap. It doesn't explain what featureData includes or how to use the parameters, leaving them largely ambiguous.

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

Purpose3/5

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

The description 'Update an existing feature flag' clearly states the action (update) and target resource (feature flag), which is better than a tautology. However, it doesn't differentiate this tool from its sibling 'createFeatureFlag' beyond the verb difference, nor does it specify what aspects can be updated. The purpose is understandable but lacks specificity about scope.

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., needing an existing feature flag), when to choose update over create, or how it relates to siblings like 'getFeatureFlag' for checking current values. Without such context, the agent must infer usage from the tool name alone.

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

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/ylin6/unleash-ff-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server