Skip to main content
Glama
bucketeer-io

Bucketeer MCP Server

Official
by bucketeer-io

archiveFeatureFlag

Archive a feature flag to make it inactive in Bucketeer. Provide the flag ID and a comment for audit trail.

Instructions

Archive a feature flag (make it inactive)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the feature flag to archive
environmentIdNoEnvironment ID (uses default if not provided)
commentYesComment for the archive action (required for audit trail)

Implementation Reference

  • The handler function that parses input with Zod, creates a BucketeerClient, updates the feature flag to archived=true, and returns a structured response or error.
    handler: async (input: unknown) => {
    	try {
    		// Validate input
    		const params = archiveFlagSchema.parse(input);
    
    		logger.debug("Archiving feature flag", params);
    
    		// Create API client
    		const client = new BucketeerClient(
    			config.bucketeerHost,
    			config.bucketeerApiKey,
    		);
    
    		// Prepare request - use UpdateFeatureRequest with archived=true
    		const request: UpdateFeatureRequest = {
    			id: params.id,
    			comment: params.comment,
    			environmentId: getEnvironmentId(params.environmentId),
    			archived: true,
    		};
    
    		// Make API call
    		const response = await client.updateFeature(request);
    
    		logger.info(`Successfully archived feature flag: ${params.id}`);
    
    		return {
    			content: [
    				{
    					type: "text",
    					text: JSON.stringify(
    						{
    							success: true,
    							message: `Feature flag '${params.id}' has been archived`,
    							archivedId: params.id,
    							feature: response.feature,
    						},
    						null,
    						2,
    					),
    				},
    			],
    		};
    	} catch (error) {
    		logger.error("Failed to archive 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 used internally for input validation in the archiveFeatureFlag tool handler.
    export const archiveFlagSchema = z.object({
    	id: z.string().min(1, "Feature flag ID is required"),
    	environmentId: z.string().optional(),
    	comment: z.string().min(1, "Comment is required for archiving"),
    });
  • JSON schema defining the input structure for the archiveFeatureFlag tool, used for MCP tool protocol.
    inputSchema: {
    	type: "object" as const,
    	properties: {
    		id: {
    			type: "string",
    			description: "The ID of the feature flag to archive",
    		},
    		environmentId: {
    			type: "string",
    			description: "Environment ID (uses default if not provided)",
    		},
    		comment: {
    			type: "string",
    			description:
    				"Comment for the archive action (required for audit trail)",
    		},
    	},
    	required: ["id", "comment"],
    },
  • Registration of the archiveFlagTool (as archiveFeatureFlag) within the array of all available tools.
    export const tools = [
    	listFlagsTool,
    	createFlagTool,
    	getFlagTool,
    	updateFlagTool,
    	archiveFlagTool,
    ];
  • Re-export of the archiveFlagTool from the tools index for easy import elsewhere.
    export {
    	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. It states the action ('archive') and outcome ('make it inactive'), implying a mutation that changes state, but lacks details on permissions required, whether the action is reversible, audit implications from the comment parameter, or rate limits. For a mutation tool with zero 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 front-loads the core action and outcome without unnecessary words. It directly communicates the tool's purpose ('archive a feature flag') and result ('make it inactive'), making it easy to parse. Every part of the sentence earns its place by clarifying the tool's intent concisely.

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 as a mutation operation with no annotations and no output schema, the description is incomplete. It lacks information on behavioral aspects like side effects, return values, error handling, or how it integrates with sibling tools. For a tool that archives resources, more context on implications and usage is needed to be fully helpful to an AI agent.

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%, so the schema already documents all three parameters (id, environmentId, comment) with their purposes. The description adds no additional parameter semantics beyond implying archiving affects a feature flag's activity state. Since the schema handles the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate for or enhance parameter understanding.

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 ('archive') and resource ('feature flag'), specifying the outcome ('make it inactive'). It distinguishes from siblings like create, get, list, and update by focusing on deactivation rather than creation, retrieval, or modification. However, it doesn't explicitly contrast with potential delete operations or other archival tools, keeping it from a perfect score.

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 updateFeatureFlag for status changes or delete operations. It mentions making the flag 'inactive', which implies a state change, but doesn't clarify prerequisites, consequences, or typical scenarios for archiving over other actions. Without such context, users 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/bucketeer-io/bucketeer-mcp'

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