Skip to main content
Glama
bucketeer-io

Bucketeer MCP Server

Official
by bucketeer-io

listFeatureFlags

Retrieve all feature flags from a Bucketeer environment with filtering, pagination, and search options to manage feature rollouts.

Instructions

List all feature flags in the specified environment

Input Schema

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

Implementation Reference

  • The handler function that executes the tool logic: validates input using Zod schema, initializes BucketeerClient, prepares the ListFeaturesRequest, calls the API, logs results, and returns structured content or error response.
    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 input schema used for validating the parameters in the handler.
    // Input schema for the list-flags 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(), });
  • Registration of the listFeatureFlags tool (as listFlagsTool) in the central tools array exported from the tools index.
    export const tools = [ listFlagsTool, createFlagTool, getFlagTool, updateFlagTool, archiveFlagTool, ];
  • Tool object definition including the name 'listFeatureFlags', description, and reference to inputSchema and handler.
    export const listFlagsTool = { name: "listFeatureFlags", description: "List all feature flags in the specified environment",

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