Skip to main content
Glama

Unleash MCP (Feature Toggle)

flag-check.ts1.52 kB
/** * Feature flag check prompt for Unleash MCP Server */ import { z } from 'zod'; /** * Define the unleash context schema based on its documentation */ const UnleashContextSchema = z.object({ userId: z.string().optional(), sessionId: z.string().optional(), remoteAddress: z.string().optional(), properties: z.record(z.string()).optional(), environment: z.string().optional(), appName: z.string().optional() }).passthrough(); /** * Parameters schema for the feature flag check prompt */ export const FlagCheckParamsSchema = { flagName: z.string(), context: UnleashContextSchema.optional() }; /** * Handler for the feature flag check prompt */ export function handleFlagCheckPrompt({ flagName, context = {} }: { flagName: string; context?: any }) { return { messages: [{ role: "user", content: { type: "text", text: `Please check if the feature flag '${flagName}' is enabled with the following context: ${JSON.stringify(context, null, 2)} Use the 'isEnabled' tool to check the feature flag status. Based on the result, determine if the feature is available and what actions should be taken. If the feature is enabled, explain what functionality should be provided. If the feature is disabled, explain what alternative behavior should be shown.` } }] }; } /** * Prompt definition for feature flag check */ export const flagCheckPrompt = { name: "checkFeatureFlag", paramsSchema: FlagCheckParamsSchema, handler: handleFlagCheckPrompt };

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/cuongtl1992/unleash-mcp'

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