Skip to main content
Glama
bucketeer-io

Bucketeer MCP Server

Official
by bucketeer-io

getFeatureFlag

Retrieve a specific feature flag by ID from the Bucketeer MCP Server to manage feature configurations and enable/disable functionality.

Instructions

Get a specific feature flag by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the feature flag to retrieve
environmentIdNoEnvironment ID (uses default if not provided)
featureVersionNoSpecific version of the feature to retrieve

Implementation Reference

  • The core handler function for the 'getFeatureFlag' tool. It validates the input using Zod schema, initializes the BucketeerClient, makes an API request to retrieve the feature flag, logs the operation, and returns a structured MCP response (success or error).
    handler: async (input: unknown) => {
    	try {
    		// Validate input
    		const params = getFlagSchema.parse(input);
    
    		logger.debug("Getting feature flag", params);
    
    		// Create API client
    		const client = new BucketeerClient(
    			config.bucketeerHost,
    			config.bucketeerApiKey,
    		);
    
    		// Prepare request
    		const request: GetFeatureRequest = {
    			id: params.id,
    			environmentId: getEnvironmentId(params.environmentId),
    			featureVersion: params.featureVersion,
    		};
    
    		// Make API call
    		const response = await client.getFeature(request);
    
    		logger.info(
    			`Successfully retrieved feature flag: ${response.feature.id}`,
    		);
    
    		return {
    			content: [
    				{
    					type: "text",
    					text: JSON.stringify(
    						{
    							success: true,
    							feature: response.feature,
    						},
    						null,
    						2,
    					),
    				},
    			],
    		};
    	} catch (error) {
    		logger.error("Failed to get 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 input schema used for validating the parameters in the getFeatureFlag handler.
    export const getFlagSchema = z.object({
    	id: z.string().min(1, "Feature flag ID is required"),
    	environmentId: z.string().optional(),
    	featureVersion: z.number().optional(),
    });
  • JSON schema definition for the input of the getFeatureFlag tool, used by MCP for tool listing and validation.
    inputSchema: {
    	type: "object" as const,
    	properties: {
    		id: {
    			type: "string",
    			description: "The ID of the feature flag to retrieve",
    		},
    		environmentId: {
    			type: "string",
    			description: "Environment ID (uses default if not provided)",
    		},
    		featureVersion: {
    			type: "number",
    			description: "Specific version of the feature to retrieve",
    		},
    	},
    	required: ["id"],
    },
  • The getFlagTool (containing getFeatureFlag) is registered in the central tools array exported for use by the MCP server.
    export const tools = [
    	listFlagsTool,
    	createFlagTool,
    	getFlagTool,
    	updateFlagTool,
    	archiveFlagTool,
    ];
  • src/server.ts:8-8 (registration)
    Import of the tools array (including getFeatureFlag) into the MCP server for handling listTools and callTool requests.
    import { tools } from "./tools/index.js";
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 the tool retrieves a flag but doesn't mention whether this is a read-only operation, if it requires authentication, what happens if the ID doesn't exist, or any rate limits. For a retrieval 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 with zero waste. It's appropriately sized for a simple retrieval tool and front-loaded with the core action, making it easy 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 tool's complexity (retrieval with 3 parameters) and lack of annotations and output schema, the description is incomplete. It doesn't explain return values, error conditions, or how optional parameters like 'environmentId' and 'featureVersion' affect behavior, leaving gaps for the agent to navigate.

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%, meaning all parameters are documented in the input schema. The description adds no additional meaning beyond implying retrieval by ID, which is already covered. This meets the baseline of 3 when the schema does the heavy lifting, but no extra value is provided.

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 ('Get') and resource ('a specific feature flag by ID'), making the purpose understandable. However, it doesn't explicitly distinguish this from sibling tools like 'listFeatureFlags' or 'archiveFeatureFlag', which would require more specific differentiation to earn a 5.

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 'listFeatureFlags' for multiple flags or 'updateFeatureFlag' for modifications. It lacks context about prerequisites or exclusions, leaving the agent to 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