Skip to main content
Glama

Customer lifetime and retention

get_customer_lifetime
Read-onlyIdempotent

How customers behave over their whole history (no period): orders per customer, median days between a customer's orders (medianGapDays), lifecycle segments active, loyal, atRisk, inactive and vip (vip is the top tenth by value and overlaps the other four) with customers, orders and revenue, 90-day repurchase per monthly cohort (cohorts90: of those who first bought that month, how many reordered within 90 days), 365-day value per acquisition channel (ltvByChannel), the RFM split (rfm), and month-by-month retention (retention.cohorts: customers per first-order month and how many bought again N months later; null = that month has not happened yet, not zero). atRisk and recentlyChurned list a few customers by an opaque id only — never present one as a name; atRiskCount and recentlyChurnedCount are the full counts. Use for retention, cohorts, churn, loyalty or 'how often do customers come back'. suppressed true = too little revenue carries a customer id: say so.

Input Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, closed-world), so the description spends its words on behavior the agent could not otherwise know: null means a month has not happened yet rather than zero, atRisk/recentlyChurned expose only opaque ids that must never be rendered as names, counts are authoritative, and suppressed=true must be surfaced. Without an output schema these interpretation rules are essential and are stated explicitly.

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?

Purpose is front-loaded in the first clause and every subsequent clause carries non-redundant information (field names, null semantics, id caveat, suppressed handling). It is delivered as one very long run-on sentence though, which makes the embedded warnings easy to skim past; breaking the caveats out would improve scannability.

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?

With no output schema and no parameters, the description must carry the entire return-value contract, and it does: it names the key structures, explains the vip overlap, the cohort null rule, the opaque-id limitation, and the suppressed flag. An agent has everything needed to call it and interpret the result.

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?

The tool takes zero parameters, so there is nothing to disambiguate; the description correctly spends no space on inputs and instead documents output shape. Baseline 4 applies for a parameterless tool.

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 resource and its scope immediately: customer behavior over whole history with no period, then enumerates the exact metric families returned (segments, cohorts90, ltvByChannel, rfm, retention.cohorts). The field-level naming makes it unmistakably distinct from the sibling get_customers, which lists individual customers.

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?

The 'Use for retention, cohorts, churn, loyalty or how often do customers come back' line gives clear topic-based routing, including a natural-language trigger phrase an agent can match. It lacks an explicit exclusion or a named alternative (e.g., 'for individual customer records use get_customers'), which keeps it short of a 5.

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