run_cohort_definition
Build and execute an ad-hoc cohort (player segment) definition. Validates the definition AST, counts matching players, and returns the definition plus a compact summary. Returns { error } on invalid input. Not for querying saved cohorts (use get_cohort_member_count). Load the cohorts skill (load_skill("cohorts")) first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Short, descriptive cohort name (e.g. 'Churned big spenders'). | |
| projectId | Yes | The project (application) id to scope this call to. Use list_projects to discover valid ids. | |
| definition | Yes | ||
| description | No | One or two plain-language sentences saying who is in the cohort, including the time window (e.g. 'Players who made at least 5 purchases in the last 30 days.'). Pre-fills the description when the cohort is saved. Always set it. | |
| environment | Yes | The environment name to scope this call to (e.g. 'production'). Use list_projects to discover the names available to this token. |