Copy flag config between environments
copy_flag_configCopy a flag's targeting, rules, prerequisites, and default variation between environments; preview changes by default, then apply with matching ETags after review.
Instructions
Copy one flag's targeting (default variation, strategy, rules, prerequisites) from one environment into another. On/off is copied only with include_state: true. Previews by default (dry_run: true) and changes nothing; review before/after, changedSections and warnings, then call again with dry_run: false plus the preview's sourceETag and targetETag as source_etag/target_etag to apply. If the apply is refused with 412, something changed since the preview: preview again. Applying needs both ETags, and the same source and include_state as the preview (the ETags record environment state, not the request). Team plan and above.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project": "<project>",
"flag": "<flag>",
"source": "<source>",
"target": "<target>"
},
"name": "copy_flag_config"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flag | Yes | Flag key or id | |
| reason | No | Why you are making this change. Recorded in the audit log, and required when the environment (or, for project-wide changes, any environment in the project) is marked critical. | |
| source | Yes | Environment key to copy from | |
| target | Yes | Environment key to copy into | |
| dry_run | No | Preview only, change nothing (default true). Pass false to apply, with both ETags from a preview made with the same source and include_state | |
| project | Yes | Project key | |
| source_etag | No | sourceETag from the preview; the apply is refused (412) if the source changed since | |
| target_etag | No | targetETag from the preview; the apply is refused (412) if the target changed since | |
| include_state | No | Also copy the on/off state (default false). When applying, use the same value as the preview |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | ||
| before | No | ||
| changed | No | ||
| warnings | No | ||
| sourceETag | No | ||
| targetETag | No | ||
| changedSections | No |