Skip to main content
Glama

Cohort Retention

get_retention
Read-onlyIdempotent

Retrieve weekly cohort retention: users grouped by first-seen week, showing the share still active in each subsequent week. Use it to track product engagement over time.

Instructions

Weekly cohort retention for the product: users grouped by first-seen week (one row per cohort, newest last), with the share still active each subsequent week — a lower-triangular grid. Needs product-analytics events flowing; returns empty cohorts when the product has none. window_days default 56 = 8 weekly cohorts (min 7; roughly one extra cohort per added 7 days). product_id optional (primary product when omitted).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
product_idNoProduct id, from whoami (optional; the org's primary product when omitted).
window_daysNoLookback window in days (optional; default 56 = 8 weekly cohorts).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.14
  2. Removedv0.1.13
  3. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Discloses significant behavioral traits beyond the annotations: output ordering ('newest last'), empty-cohort behavior, default window_days mapping to 8 cohorts, and the optional product_id fallback to primary product. This gives the agent a strong mental model of the tool's runtime behavior.

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?

Four sentences, roughly 70 words, front-loaded with the core purpose. Every sentence earns its place: output shape, prerequisites, parameter behavior, and fallback logic. No fluff or repetition.

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

Completeness5/5

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

Despite having no output schema, the description thoroughly covers the return format (grid), ordering, empty-case behavior, and parameter defaults. The tool is simple (2 optional params), and this description fully equips an agent to invoke it correctly.

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 already documents both parameters with 100% coverage. The description adds extra meaning for window_days by explaining the relationship to cohort count ('56 = 8 weekly cohorts') and the effect of added days. product_id description adds no new info beyond schema, but the window_days semantics justify above baseline.

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?

Description states exactly what the tool does: computes weekly cohort retention with a specific output shape ('lower-triangular grid', one row per cohort). The verb+resource is clear and distinct from sibling analytics tools like analyze_funnel or analyze_paths.

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?

Provides clear context for use: requires product-analytics events, and returns empty cohorts when no data. It doesn't explicitly name alternatives or exclusions, but the prerequisite and edge case are clearly communicated.

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