Skip to main content
Glama
bucketeer-io

Bucketeer MCP Server

Official
by bucketeer-io

listFeatureFlags

Retrieve and filter feature flags from Bucketeer by environment, tags, maintainer, or search terms to manage feature rollout and configuration.

Instructions

List all feature flags in the specified environment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
archivedNoFilter by archived status
cursorNoPagination cursor for next page
environmentIdNoEnvironment ID (uses default if not provided)
maintainerNoFilter by maintainer email
orderByNoField to order by
orderDirectionNoOrder direction
pageSizeNoNumber of items per page (1-100)
searchKeywordNoSearch keyword for feature name or ID
tagsNoFilter by tags

Implementation Reference

  • The handler function that parses input, calls the Bucketeer API to list feature flags, and returns a formatted JSON response or handles errors.
    handler: async (input: unknown) => { try { // Validate input const params = listFlagsSchema.parse(input); logger.debug("Listing feature flags", params); // Create API client const client = new BucketeerClient( config.bucketeerHost, config.bucketeerApiKey, ); // Prepare request const request: ListFeaturesRequest = { environmentId: getEnvironmentId(params.environmentId), pageSize: params.pageSize, cursor: params.cursor, tags: params.tags, orderBy: params.orderBy, orderDirection: params.orderDirection, searchKeyword: params.searchKeyword, maintainer: params.maintainer, archived: params.archived, }; // Make API call const response = await client.listFeatures(request); logger.info( `Successfully listed ${response.features.length} feature flags`, ); return { content: [ { type: "text", text: JSON.stringify( { success: true, features: response.features, cursor: response.cursor, totalCount: response.totalCount, }, null, 2, ), }, ], }; } catch (error) { logger.error("Failed to list feature flags", 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 for validating the input parameters of the listFeatureFlags tool.
    export const listFlagsSchema = z.object({ environmentId: z.string().optional(), pageSize: z.number().min(1).max(100).optional().default(20), cursor: z.string().optional(), tags: z.array(z.string()).optional(), orderBy: z.enum(["CREATED_AT", "UPDATED_AT", "NAME"]).optional(), orderDirection: z.enum(["ASC", "DESC"]).optional(), searchKeyword: z.string().optional(), maintainer: z.string().optional(), archived: z.boolean().optional(), });
  • Registers the listFlagsTool (listFeatureFlags) by importing and adding it to 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, ];
  • src/server.ts:8-66 (registration)
    MCP server setup that imports the tools array and registers generic handlers for listing tools and executing tool handlers by name, including listFeatureFlags.
    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; } }); }

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