volanea_create_segment
Create a dynamic audience segment from a condition tree (membership recomputes automatically). With dryRun: true it returns the live member count and a sample of matching contacts without creating anything, so the filter can be checked before the segment is saved. Idempotent by name.
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": {
"conditions": "<conditions>"
},
"name": "volanea_create_segment"
}
}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). | |
| project_id | No | Which project to act on — a projectId from volanea_list_projects. Optional when this connection reaches exactly one project; required when it reaches several (the call fails with the list of projects instead of guessing). A project API key only ever reaches its own project. | |
| 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. |