Add, update, remove, or reorder one targeting rule
manage_targeting_ruleEdit a single targeting rule without replacing all rules. Add, update, remove, or reorder one rule to change conditions, rollout percentage, or evaluation order.
Instructions
Edit a single targeting rule instead of replacing them all with update_targeting. action=add needs rule (appended last); action=update needs ruleId + rule and changes only the fields you pass (conditionGroups replaces the rule's groups; to clear rolloutPercentage or userSegmentId use update_targeting); action=remove needs ruleId; action=reorder needs ruleIds, every existing rule id exactly once, in the new order. Rule ids come from get_targeting.
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": {
"action": "<action>",
"project": "<project>",
"flag": "<flag>",
"environment": "<environment>"
},
"name": "manage_targeting_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flag | Yes | Flag key or id | |
| rule | No | Rule fields; required for add and update | |
| action | Yes | add needs rule; update needs ruleId + rule; remove needs ruleId; reorder needs ruleIds | |
| 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. | |
| ruleId | No | Rule id from get_targeting; required for update and remove | |
| project | Yes | Project key | |
| ruleIds | No | Every rule id exactly once, in evaluation order; required for reorder | |
| environment | Yes | Environment key, e.g. production |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||