delete_distribution
Remove a specific distribution for a feature flag rule in Flipt MCP Server by specifying namespace, flag, rule, and distribution IDs.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| distributionId | Yes | ||
| flagKey | Yes | ||
| namespaceKey | Yes | ||
| ruleId | Yes |
Implementation Reference
- src/index.ts:1042-1080 (handler)The primary MCP tool handler for 'delete_distribution'. Registers the tool with input schema and executes the deletion via fliptClient, returning success or error content.server.tool( 'delete_distribution', { namespaceKey: z.string().min(1), flagKey: z.string().min(1), ruleId: z.string().min(1), distributionId: z.string().min(1), }, async args => { try { await fliptClient.deleteDistribution( args.namespaceKey, args.flagKey, args.ruleId, args.distributionId ); return { content: [ { type: 'text', text: `Successfully deleted distribution ${args.distributionId} from rule ${args.ruleId}`, }, ], }; } catch (error: any) { console.error('Error deleting distribution:', error); return { content: [ { type: 'text', text: `Failed to delete distribution: ${error.message}`, }, ], isError: true, }; } } );
- src/services/fliptClient.ts:638-646 (helper)Helper method in FliptClient class that wraps the generated API call to delete a distribution.async deleteDistribution(namespaceKey: string, flagKey: string, ruleId: string, id: string) { try { await this.distributionsApi.deleteDistribution(namespaceKey, flagKey, ruleId, id); return { success: true }; } catch (error) { console.error('Error deleting distribution:', error); throw error; } }
- src/index.ts:1044-1049 (schema)Zod input schema for the delete_distribution tool parameters.{ namespaceKey: z.string().min(1), flagKey: z.string().min(1), ruleId: z.string().min(1), distributionId: z.string().min(1), },