Skip to main content
Glama
nnnkkk7

Bucketeer MCP Server

by nnnkkk7

updateFeatureFlag

Modify feature flag settings including name, description, tags, and status to control feature rollout and management in Bucketeer environments.

Instructions

Update an existing feature flag

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the feature flag to update
commentYesComment for the update (required for audit trail)
environmentIdNoEnvironment ID (uses default if not provided)
nameNoNew name for the feature flag
descriptionNoNew description for the feature flag
tagsNoNew tags for the feature flag
enabledNoEnable or disable the feature flag
archivedNoArchive or unarchive the feature flag

Implementation Reference

  • The handler function that executes the tool: parses input with Zod schema, creates BucketeerClient, builds UpdateFeatureRequest, calls API, handles success/error responses.
    handler: async (input: unknown) => {
      try {
        // Validate input
        const params = updateFlagSchema.parse(input);
        
        logger.debug('Updating feature flag', params);
        
        // Create API client
        const client = new BucketeerClient(config.bucketeerHost, config.bucketeerApiKey);
        
        // Prepare request
        const request: UpdateFeatureRequest = {
          id: params.id,
          comment: params.comment,
          environmentId: getEnvironmentId(params.environmentId),
        };
        
        // Only add fields that are being updated
        if (params.name !== undefined) {
          request.name = params.name;
        }
        if (params.description !== undefined) {
          request.description = params.description;
        }
        if (params.tags !== undefined) {
          request.tags = { values: params.tags };
        }
        if (params.enabled !== undefined) {
          request.enabled = params.enabled;
        }
        if (params.archived !== undefined) {
          request.archived = params.archived;
        }
        
        // Make API call
        const response = await client.updateFeature(request);
        
        logger.info(`Successfully updated feature flag: ${response.feature.id}`);
        
        return {
          content: [{
            type: 'text',
            text: JSON.stringify({
              success: true,
              feature: response.feature,
              updated: {
                ...(params.name !== undefined && { name: params.name }),
                ...(params.description !== undefined && { description: params.description }),
                ...(params.tags !== undefined && { tags: params.tags }),
                ...(params.enabled !== undefined && { enabled: params.enabled }),
                ...(params.archived !== undefined && { archived: params.archived }),
              },
            }, null, 2),
          }],
        };
      } catch (error) {
        logger.error('Failed to update feature flag', error);
        
        if (error instanceof z.ZodError) {
          return {
            content: [{
              type: 'text',
              text: JSON.stringify({
                success: false,
                error: 'Invalid input parameters',
                details: error.errors,
              }, null, 2),
            }],
            isError: true,
          };
        }
        
        return {
          content: [{
            type: 'text',
            text: JSON.stringify({
              success: false,
              error: error instanceof Error ? error.message : 'Unknown error',
            }, null, 2),
          }],
          isError: true,
        };
      }
    },
  • Zod schema (updateFlagSchema) used in handler for input validation, ensuring required fields and at least one update field.
    export const updateFlagSchema = z.object({
      id: z.string().min(1, 'Feature flag ID is required'),
      comment: z.string().min(1, 'Comment is required for all updates'),
      environmentId: z.string().optional(),
      name: z.string().optional(),
      description: z.string().optional(),
      tags: z.array(z.string()).optional(),
      enabled: z.boolean().optional(),
      archived: z.boolean().optional(),
    }).refine(
      data => {
        // At least one update field must be provided
        return data.name !== undefined || 
               data.description !== undefined || 
               data.tags !== undefined || 
               data.enabled !== undefined || 
               data.archived !== undefined;
      },
      { message: 'At least one field to update must be provided' }
    );
  • JSON schema (inputSchema) defined in tool object for MCP protocol input validation.
    inputSchema: {
      type: 'object' as const,
      properties: {
        id: {
          type: 'string',
          description: 'The ID of the feature flag to update',
        },
        comment: {
          type: 'string',
          description: 'Comment for the update (required for audit trail)',
        },
        environmentId: {
          type: 'string',
          description: 'Environment ID (uses default if not provided)',
        },
        name: {
          type: 'string',
          description: 'New name for the feature flag',
        },
        description: {
          type: 'string',
          description: 'New description for the feature flag',
        },
        tags: {
          type: 'array',
          items: { type: 'string' },
          description: 'New tags for the feature flag',
        },
        enabled: {
          type: 'boolean',
          description: 'Enable or disable the feature flag',
        },
        archived: {
          type: 'boolean',
          description: 'Archive or unarchive the feature flag',
        },
      },
      required: ['id', 'comment'],
    },
  • Registration of the updateFlagTool as part of the exported tools array for MCP server.
    export const tools = [
      listFlagsTool,
      createFlagTool,
      getFlagTool,
      updateFlagTool,
      archiveFlagTool,
    ];
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. 'Update an existing feature flag' implies a mutation operation, but it doesn't disclose critical traits like required permissions, whether changes are reversible, rate limits, or what happens to unspecified fields. For a mutation tool with 8 parameters and no annotation coverage, this is a significant gap in transparency.

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 states the core purpose without any wasted words. It's appropriately sized for a tool with good schema coverage and gets straight to the point. Every word earns its place, 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 complexity (8 parameters, mutation operation) and lack of both annotations and output schema, the description is insufficiently complete. It doesn't explain what fields can be updated, what the response looks like, or behavioral constraints. For a feature flag management tool with multiple sibling alternatives, more context about scope and limitations would be needed for effective agent use.

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?

Schema description coverage is 100%, with all 8 parameters well-documented in the input schema. The description adds no parameter-specific information beyond what's in the schema, so it doesn't enhance understanding of individual parameters. However, the baseline score of 3 is appropriate since the schema already provides comprehensive parameter 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 action ('Update') and resource ('an existing feature flag'), making the purpose immediately understandable. It doesn't differentiate from sibling tools like 'createFeatureFlag' or 'archiveFeatureFlag', but the verb 'Update' versus 'Create' or 'Archive' provides basic distinction. The description is specific enough to understand what the tool does without being tautological.

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 'archiveFeatureFlag' or 'createFeatureFlag'. It doesn't mention prerequisites (e.g., that the feature flag must exist), exclusions, or contextual factors that would help an agent choose between sibling tools. 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/nnnkkk7/bucketeer-mcp'

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