Skip to main content
Glama
nnnkkk7

Bucketeer MCP Server

by nnnkkk7

getFeatureFlag

Retrieve a specific feature flag by its ID from the Bucketeer MCP Server to check current status and configuration settings.

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 handler function that executes the tool logic: validates input with Zod, creates BucketeerClient, fetches the feature flag via API, logs, and returns structured response 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.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,
        };
      }
    },
  • JSON Schema defining the input parameters for the getFeatureFlag tool: id (required string), optional environmentId and featureVersion.
    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'],
    },
  • Zod schema for internal input validation 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(),
    });
  • Registration of getFlagTool by importing it and adding to the central tools array used by the MCP server.
    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,
    ];
  • src/server.ts:8-65 (registration)
    MCP server request handlers for listing tools and calling tools, which use the imported tools array (including getFeatureFlag) to provide tool metadata and execute handlers.
    import { tools } from './tools/index.js';
    
    export class BucketeerMCPServer {
      private server: Server;
    
      constructor() {
        this.server = new Server(
          {
            name: 'bucketeer-mcp-server',
            version: '1.0.0',
          },
          {
            capabilities: {
              tools: {},
            },
          }
        );
    
        this.setupHandlers();
        this.setupErrorHandling();
      }
    
      private setupHandlers() {
        // Handle list tools request
        this.server.setRequestHandler(ListToolsRequestSchema, async () => {
          logger.debug('Listing available tools');
          
          return {
            tools: tools.map(tool => ({
              name: tool.name,
              description: tool.description,
              inputSchema: tool.inputSchema,
            })),
          };
        });
    
        // Handle tool calls
        this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
          const { name, arguments: args } = request.params;
          
          logger.info(`Tool called: ${name}`, { arguments: args });
          
          const tool = tools.find(t => t.name === name);
          
          if (!tool) {
            logger.error(`Tool not found: ${name}`);
            throw new Error(`Tool not found: ${name}`);
          }
          
          try {
            const result = await tool.handler(args);
            logger.info(`Tool ${name} executed successfully`);
            return result;
          } catch (error) {
            logger.error(`Tool ${name} execution failed`, error);
            throw error;
          }
        });
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 feature flag but doesn't describe what happens if the ID doesn't exist (e.g., error handling), whether it's idempotent, authentication needs, rate limits, or the return format. For a read operation with zero annotation coverage, this leaves significant gaps in understanding the tool's 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 that directly states the tool's purpose without any wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every part of the sentence earns its place by conveying essential information.

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 moderate complexity (3 parameters, no output schema, no annotations), the description is incomplete. It lacks details on behavioral traits (e.g., error handling, return format), usage context relative to siblings, and doesn't address what 'Get' entails beyond the basic action. For a tool with no annotations or output schema, more descriptive context is needed to fully inform an 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 input schema already documents all three parameters (id, environmentId, featureVersion) with clear descriptions. The description adds no additional meaning beyond implying 'id' is required (matching the schema's required field). Baseline 3 is appropriate as the schema does the heavy lifting, but the description doesn't compensate 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 ('Get') and resource ('a specific feature flag by ID'), making the purpose immediately understandable. It distinguishes from siblings like 'listFeatureFlags' by specifying retrieval of a single item rather than a collection. However, it doesn't explicitly contrast with other siblings like 'archiveFeatureFlag' or 'updateFeatureFlag' beyond the verb difference.

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 flag ID), exclusions (e.g., not for creating or modifying flags), or direct comparisons to siblings like 'listFeatureFlags' for bulk retrieval. Usage is implied by the verb 'Get' but lacks explicit context.

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