Create, update, or delete a user segment
manage_segmentCreate, update, or delete reusable user segments referenced by targeting rules, using ifMatch checks to prevent overwriting concurrent changes.
Instructions
Manage reusable user segments, which targeting rules reference by userSegmentId. action=create needs key + name (+ conditions); action=update needs segment and changes only the fields you pass (conditions replaces the whole list; description: "" clears it); action=delete needs segment. On update, pass ifMatch (the etag from get_segment) so a change someone made since you read it is not overwritten. ifMatch is rejected on create and delete: the API cannot make those conditional.
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>"
},
"name": "manage_segment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | New segment key, required for create; immutable afterwards | |
| name | No | Display name; required for create | |
| action | Yes | create needs key + name; update and delete need segment | |
| 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. | |
| ifMatch | No | etag from get_segment. The write is refused with 412 if the resource changed since that read; re-read and re-apply. Omit to write unconditionally. | |
| project | Yes | Project key | |
| segment | No | Segment key or id; required for update and delete | |
| conditions | No | Conditions a user must match to be in the segment; on update, replaces the whole list | |
| description | No | What the segment means; "" clears it |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||