Skip to main content
Glama

analyze_cohorts

Calculate cohort sizes and month-level retention from user event records. Group users by earliest event month to measure acquisition cohorts and retention.

Instructions

Calculate cohort sizes and month-level retention from user event records.

Expected fields: user_id, event_date/date, and event_name. The earliest valid event month for each user is treated as that user's acquisition cohort.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_eventsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose one meaningful trait: the earliest valid event month per user becomes the acquisition cohort, plus the expected input fields. However, it omits what 'valid' means, how invalid/missing dates are handled, and timezone/aggregation behavior, leaving notable gaps for a computation tool.

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

Conciseness5/5

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

Three short sentences, front-loaded with the outcome followed by input requirements and the cohort rule. Every sentence earns its place with 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?

An output schema exists, so return values need not be explained, and the description covers input shape and the core cohort semantics. It is close to complete, missing only edge-case handling for malformed or missing event fields.

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

Parameters4/5

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

Schema coverage is 0% and the single parameter is an opaque array with additionalProperties, so the schema alone conveys nothing. The description compensates well by naming the required field names (user_id, event_date/date, event_name) and the accepted date-field aliases, though it doesn't state required vs optional per field.

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

Purpose4/5

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

The description states a specific verb+resource: it calculates cohort sizes and month-level retention, with a clear input domain (user event records). No sibling in the list performs cohort analysis, but the description never explicitly distinguishes itself from adjacent analytics tools like calculate_growth_metrics or analyze_growth_query, so it stops short of a 5.

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

Usage Guidelines2/5

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

There is no explicit when-to-use or when-not-to-use guidance, and no alternatives are named among the many analytics siblings. The only contextual help is the cohort definition, which is behavioral rather than selection guidance.

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