Skip to main content
Glama

run_retention_query

Read-only

Build and execute an ad-hoc retention analytics query: of the players who did a start event, how many came back and did a return event N days/weeks/months later. Returns retention data for rendering plus a compact summary for analysis. A global filter or breakdown on a property or argument needs that column, with the same dataType, on both events; put a condition that applies to both in the global filters once (not also per event), and segment players by behavior with a cohort filter or breakdown. Load the retention-queries skill (load_skill("retention-queries")) first.

Input Schema

NameRequiredDescriptionDefault
specYes
titleYesA short, lean chart title describing the retention measured (e.g. 'Day-1 retention'). Do NOT include the time range.
projectIdYesThe project (application) id to scope this call to. Use list_projects to discover valid ids.
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 already establish readOnlyHint=true and openWorldHint=false, so safety is covered, and the description adds valuable behavior beyond that: the call returns retention data for rendering plus a compact summary for analysis, and it mandates a skill load before invocation. It does not discuss execution cost, latency, or result size limits for large time ranges, which is the remaining gap.

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 and return shape are front-loaded in the first two sentences, with the operational rules and the skill prerequisite trailing. The third sentence is dense and slightly parsing-heavy ('A global filter or breakdown on a property or argument needs that column, with the same dataType, on both events'), but every clause carries actionable instruction rather than filler.

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?

For a deeply nested 4-parameter query-builder with no output schema, the description covers purpose, return shape, the two-event model, filter placement rules, and a pointer to a skill that presumably supplies spec examples. An agent has enough to decide to call it and to know what to load before constructing the spec.

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 75% and the nested schema already documents metrics as exactly two events and describes measurement/computeMode/retentionGroup. The description adds semantics the schema cannot express: how a filter or breakdown must reference the same column with the same dataType on both events, and that shared conditions belong in global filters rather than duplicated per event. That is genuine guidance beyond the structured fields.

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 opens with a concrete verb+resource ('Build and execute an ad-hoc retention analytics query') and then defines the retention semantics precisely: players who did a start event and returned to do a return event N days/weeks/months later. The word 'ad-hoc' implicitly separates it from the create/update_retention_query siblings, though it never names them explicitly.

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?

It gives real operating context: this is for ad-hoc retention analysis, a global filter or breakdown requires matching columns/dataTypes on both events, and a condition applying to both belongs in the global filters once. It also declares a hard prerequisite (loading the retention-queries skill first). It stops short of naming alternatives such as create_retention_query or run_insight_query, so the when-not case is left to inference.

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