Skip to main content
Glama
flipt-io

Flipt MCP Server

Official
by flipt-io

evaluate_variant_flag

Assess feature flag variants by specifying namespace, flag key, and entity ID to determine targeted configurations for specific contexts using the MCP server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextNo
entityIdYes
flagKeyYes
namespaceKeyYes

Implementation Reference

  • MCP tool registration and handler implementation for 'evaluate_variant_flag'. Includes input schema validation using Zod and the execution logic that calls FliptClient to evaluate the variant flag.
    server.tool( 'evaluate_variant_flag', { namespaceKey: z.string().min(1), flagKey: z.string().min(1), entityId: z.string().min(1), context: z.record(z.string()).optional(), }, async args => { try { const response = await fliptClient.evaluateVariant( args.namespaceKey, args.flagKey, args.entityId, args.context ); return { content: [ { type: 'text', text: JSON.stringify(response, null, 2), }, ], }; } catch (error: any) { console.error('Error evaluating variant flag:', error); return { content: [ { type: 'text', text: `Failed to evaluate variant flag: ${error.message}`, }, ], isError: true, }; } } );
  • Input schema (Zod) for the evaluate_variant_flag tool defining parameters: namespaceKey, flagKey, entityId, and optional context.
    { namespaceKey: z.string().min(1), flagKey: z.string().min(1), entityId: z.string().min(1), context: z.record(z.string()).optional(),
  • Helper method in FliptClient that wraps the generated API call to EvaluationServiceApi.evaluateVariant for evaluating variant flags.
    async evaluateVariant( namespaceKey: string, flagKey: string, entityId: string, context: Record<string, string> = {} ) { try { const response = await this.evaluationApi.evaluateVariant({ namespaceKey, flagKey, entityId, context, }); return response; } catch (error) { console.error('Error evaluating variant flag:', 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/flipt-io/mcp-server-flipt'

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