Published
Feature flag coverage
Short answer
Three endpoints cover feature flag coverage. get_feature_flag_setup_status tells you whether a provider is connected and whether any test run has reported flags. get_feature_flag_coverage returns stories with their flags, arms and the tests that ran each arm. set_story_feature_flag_relevance pins or excludes a flag for a story. The same tools are in @testchimp/cli and MCP.
Product docs: Feature flag coverage. Field-by-field reference: MCP and CLI tools. Schemas and a playground are under the Feature Flag Coverage tag in the API Reference.
Common scenarios
Check that setup worked
POST /api/mcp/get_feature_flag_setup_status takes an empty body {}. After instrumenting the app and running one test, expect anyEvaluationsIngested: true and the sources you set up in sourcesSeen. The response never contains provider credentials.
curl -sS -X POST "$TESTCHIMP_BACKEND_URL/api/mcp/get_feature_flag_setup_status" \
-H "Content-Type: application/json" \
-H "TestChimp-Api-Key: $TESTCHIMP_API_KEY" \
-d '{}'
CLI: testchimp get-feature-flag-setup-status.
List untested arms
POST /api/mcp/get_feature_flag_coverage returns stories with gaps by default (untestedOnly: true), up to maxStories (default 20, maximum 100). The default window is the last 30 days.
curl -sS -X POST "$TESTCHIMP_BACKEND_URL/api/mcp/get_feature_flag_coverage" \
-H "Content-Type: application/json" \
-H "TestChimp-Api-Key: $TESTCHIMP_API_KEY" \
-d '{
"storyOrdinalIds": [12],
"environment": "staging",
"maxStories": 10
}'
CLI:
testchimp get-feature-flag-coverage --story-ordinal-ids 12 --environment staging
testchimp get-feature-flag-coverage --folder-path plans/stories/checkout --all-arms
testchimp get-feature-flag-coverage --release 1.4.0
Each arm has a status of ARM_TESTED, ARM_TESTED_FORCED, ARM_UNTESTED or ARM_IGNORED, its rolloutPercent when the provider reports one, and coveringTests. Pass branchName to read one branch; an unknown branch returns an error.
Pin or exclude a flag for a story
POST /api/mcp/set_story_feature_flag_relevance is idempotent. state is PINNED, EXCLUDED or AUTO (reset).
curl -sS -X POST "$TESTCHIMP_BACKEND_URL/api/mcp/set_story_feature_flag_relevance" \
-H "Content-Type: application/json" \
-H "TestChimp-Api-Key: $TESTCHIMP_API_KEY" \
-d '{"storyOrdinalId": 12, "flagKey": "new-checkout", "state": "PINNED"}'
CLI: testchimp set-story-feature-flag-relevance --story-ordinal-id 12 --flag-key new-checkout --state PINNED.
Related
Frequently asked questions
How do I check that feature flag coverage is set up?
Call get_feature_flag_setup_status with an empty body. anyEvaluationsIngested is true once a test run has reported flags, and providerConnected is true once a flag provider is connected.
Does any endpoint return provider credentials?
No. Provider credentials are entered in TestChimp settings by an org admin and are never returned by the API.