Skip to main content
Glama

GA4: run retention (cohort) report

ga4_run_cohort_report
Read-onlyIdempotent

Retention for a GA4 property (properties/): people grouped by day, week (Sunday to Saturday) or month of first visit, not sign-up, and how many were active in each later period; one still running is marked incomplete. first_channel or google_ads_campaign keeps people that channel or campaign first brought; split_by="channel" puts paid channels beside the largest others.

Tools revision: d80f65c0.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "property": "<property>"
    },
    "name": "ga4_run_cohort_report"
  }
}

Input Schema

NameRequiredDescriptionDefault
cohortsNoHow many groups, 1 to 12.
propertyYes
split_byNo"channel": one table per first channel. Every paid channel is kept whatever its size, then the largest others, 8 tables at most; the rest are counted in a note.
granularityNoWEEKLY
first_channelNoA default channel group exactly as Analytics names it, such as "Paid Search".
follow_periodsNoLater periods to report for each group, 1 to 12 (30 when DAILY).
last_cohort_endNoYYYY-MM-DD. The newest group is the last whole day, week or month ending on or before it; by default the newest one that is over.
google_ads_campaignNoA Google Ads campaign name exactly as written; Analytics knows it once linked to Google Ads.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, so the bar is lower, yet the description still adds real behavior: cohorts are keyed on first visit rather than sign-up, an in-progress cohort is flagged incomplete, and split_by caps output at 8 tables with the remainder rolled into a note. It does not mention response shape, but an output schema exists so that is not required.

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?

Front-loads the core purpose, then packs the cohort definition, filter semantics and split behavior into a tight set of semicolon-delimited clauses. Dense but every clause carries distinct information; nothing is redundant with the title.

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?

With 8 parameters (only property required), rich annotations and an output schema, the description supplies the behavioral context an agent needs: cohort anchoring, incomplete-cohort handling, table caps, and default window. Only minor gaps remain, such as whether the property must be linked to Google Ads for the campaign filter to work.

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?

Beyond the 75%-covered schema it adds meaning: weeks are Sunday-to-Saturday, first_channel must be an Analytics default channel group name verbatim, and last_cohort_end defaults to the newest cohort that has already finished. The split_by and filter semantics are explained in terms of effect, not just type.

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?

Opens with a specific verb+resource ("Retention for a GA4 property") and defines the cohort model precisely: people grouped by day/week/month of first visit, with activity in later periods. That inherently separates it from ga4_run_funnel_report, ga4_run_pivot_report and ga4_run_report, though none of those siblings are named as alternatives.

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

Usage Guidelines3/5

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

The retention framing implies when to reach for it, and the first_channel / google_ads_campaign / split_by sentences explain filtering behavior. But there is no explicit 'use this instead of ga4_run_report when...' routing, and no statement of prerequisites such as the property needing a Google Ads link for the campaign filter.

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