Skip to main content
Glama
bucketeer-io

Bucketeer MCP Server

Official
by bucketeer-io

updateFeatureFlag

Modify existing feature flag settings including name, description, tags, and status to control feature rollouts 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 async handler function that executes the tool logic: validates input with Zod schema, prepares UpdateFeatureRequest, calls BucketeerClient.updateFeature API, logs, and returns structured success or error response.
    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.issues,
    							},
    							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 defining and validating the input for the updateFeatureFlag tool, requiring id and comment, allowing optional update fields, and refining to ensure at least one updatable field is present.
    // Input schema for the update-flag tool
    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" },
    	);
  • Central registration of all feature flag tools, including updateFlagTool, in the exported 'tools' array used by the MCP server.
    import { listFlagsTool } from "./list-flags.js";
    import { createFlagTool } from "./create-flag.js";
    import { getFlagTool } from "./get-flag.js";
    import { updateFlagTool } from "./update-flag.js";
    import { archiveFlagTool } from "./archive-flag.js";
    
    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 the full burden of behavioral disclosure. It states this is an update operation, implying mutation, but doesn't cover critical aspects like required permissions, whether changes are reversible, rate limits, or what the response looks like. This is inadequate for a mutation 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 any fluff. It's appropriately sized and front-loaded, with every word earning its place.

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 8 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what happens during updates (e.g., partial vs. full updates), error conditions, or return values, leaving significant gaps in understanding how to use this tool effectively.

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 all 8 parameters well-documented in the schema itself. The description adds no additional parameter information beyond what's in the schema, so it meets the baseline of 3 for high schema coverage without compensating value.

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. However, it doesn't differentiate this tool from its siblings like 'archiveFeatureFlag' or 'createFeatureFlag', which also modify feature flags in different ways.

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, such as needing an existing feature flag ID, or contextual factors like whether this is for routine updates versus major changes.

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/bucketeer-io/bucketeer-mcp'

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