volanea_create_segment
Create a dynamic audience segment from a condition tree (membership recomputes automatically). ALWAYS run once with dryRun: true first — that returns the live member count and a sample of matching contacts without creating anything, so you can confirm the filter does what you intended. Idempotent by name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Segment name. Acts as the idempotency key. Not required when dryRun is true. | |
| dryRun | No | When true, only preview the match count and sample — nothing is created or modified. Two things skew a preview: any `event.<name>` or `data.<field>` this project has never recorded is reported in `warnings` (a typo matches zero contacts and looks identical to an empty audience), and contacts created by this MCP server's own tools (volanea_track_event, volanea_test_workflow) are tagged as test artifacts and are EXCLUDED from segment evaluation entirely — seeding one will not move this count. | |
| conditions | Yes | Condition tree over contacts. `logic` combines the groups ("and"/"or"); filters *within* a group are always ANDed. Filter fields: `email`, `firstName`, `lastName`, `locale`, `subscribed`, `createdAt`, `data.<customField>` (discover custom fields with volanea_list_resources { resource: "contact_fields" }), `event.<eventName>` (product events — discover names with volanea_list_resources { resource: "event_names" }), and `email.opened` / `email.clicked` / `email.bounced`. Operators for plain/data fields: equals, notEquals, contains, notContains, greaterThan, lessThan, exists, notExists, within (requires `days`), olderThan (requires `days`). Operators for event.*/email.* activity fields: triggered, notTriggered (optional `days` restricts to a recent window). | |
| description | No | Optional note for whoever reads the segment list later — why this audience exists, not what the filter does. The conditions already say what it does. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Machine-readable failure code to branch on. Present only when success is false. | |
| data | No | Present when success is true. | |
| error | No | Human-readable failure reason. Present only when success is false. | |
| success | Yes | False when the call failed; read `error` and `code` in that case. |