Skip to main content
Glama

run_cohort_definition

Read-only

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

NameRequiredDescriptionDefault
nameYesShort, descriptive cohort name (e.g. 'Churned big spenders').
projectIdYesThe project (application) id to scope this call to. Use list_projects to discover valid ids.
definitionYes
descriptionNoOne 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.
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.1/5.0
Behavior4/5

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

Annotations only declare readOnlyHint and openWorldHint, so the description adds real value: it discloses the validate-then-count pipeline, the shape of the response (definition plus a compact summary), and the { error } failure mode on invalid input. The 'compact summary' contents are left vague, and with no output schema the return contract could be spelled out further.

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 short sentences, front-loaded with what the tool does, followed by the failure contract and routing/prerequisite notes. The two separate return-behavior sentences (definition+summary, then { error }) could be merged, but there is no filler.

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?

For a tool with a very deep input schema, no output schema, and 4 required parameters, the description covers purpose, validation behavior, failure mode, sibling routing, and a required skill prerequisite. The remaining gap is what the returned summary actually contains and any limits on definition size.

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 80%, and the schema already documents name, projectId, description, and environment, so the baseline of 3 applies. The description references the 'definition AST' but adds no meaning about the deeply nested definition structure, which is the parameter most likely to be mis-invoked.

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 chain (build, validate, execute, count) against a specific resource (an ad-hoc cohort/player-segment definition) and explicitly distinguishes the scope from saved-cohort lookups by naming get_cohort_member_count. An agent can tell this apart from create_cohort and update_cohort without opening any schema.

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

Usage Guidelines4/5

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

Gives an explicit exclusion (not for saved cohorts, use get_cohort_member_count) and a concrete prerequisite (load_skill("cohorts") first). It does not explicitly say when to use this versus create_cohort for persisting a segment, so the alternative routing is clear for one sibling but not all.

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