Skip to main content
Glama

create_cohort

Save a new cohort (player segment) in the current project, with an optional description of who is in it. Check list_cohorts first (names are unique) and dry-run the definition with run_cohort_definition so you can report its member count. Saved when this runs; explain it in reason. Load the manage-cohorts, cohorts skills (load_skill("manage-cohorts"), load_skill("cohorts")) first.

Input Schema

NameRequiredDescriptionDefault
nameYesCohort name, unique within the project (e.g. 'Whales — 5+ purchases ever').
reasonYesWhy you are making this change, in one sentence the user will read on the approval card.
projectIdYesThe project (application) id to scope this call to. Use list_projects to discover valid ids.
definitionYesThe cohort definition AST — blocks (OR'd) of groups (AND'd) of conditions. See the cohorts skill.
descriptionNoPlain-language description of who is in the cohort (including the time window) and what it is for, in one or two sentences. Always write one from the definition, even when the user did not ask for it.
environmentYesThe environment name to scope this call to (e.g. 'production'). Use list_projects to discover the names available to this token.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=false and idempotentHint=false, and the description reinforces this with 'Saved when this runs', so the mutation is explicit. It also discloses the uniqueness constraint on names (a failure mode) and that reason is surfaced on an approval card. It stops short of covering permissions, error behavior on duplicate names, or what the response contains.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four front-loaded sentences, with the save action and the uniqueness/dry-run prerequisites leading. The final sentence stacking two load_skill calls is slightly cluttered but every sentence carries actionable instruction.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The definition parameter is a deeply nested AST, so the description wisely delegates to the cohorts skill and the dry-run tool instead of restating the schema, which is appropriate. With no output schema, it still tells the agent to derive the member count via run_cohort_definition, leaving little an agent needs missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents name, reason, projectId, definition, description and environment in detail. The description adds only marginal framing ('explain it in reason', 'optional description'), and calling description 'optional' sits slightly against the schema's 'Always write one', which muddies rather than clarifies. Baseline 3 applies when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource with scope: 'Save a new cohort (player segment) in the current project'. The word 'new' implicitly separates it from the sibling update_cohort, and the parenthetical gloss makes the domain object unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit pre-flight workflow: check list_cohorts first because names are unique, then dry-run with run_cohort_definition to obtain the member count, and load the manage-cohorts/cohorts skills before calling. That is real when-to-use and how-to-prepare guidance rather than an implied usage note.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources