Skip to main content
Glama
nks-hub

rybbit-mcp

by nks-hub

User Retention

rybbit_get_retention
Read-onlyIdempotent

Analyze user retention cohorts to track how many users return over specific time periods for website analytics.

Instructions

Get user retention cohort analysis showing how many users return over time periods.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteIdYesSite ID (numeric ID or domain identifier)
startDateNoStart date in ISO format (YYYY-MM-DD)
endDateNoEnd date in ISO format (YYYY-MM-DD)
timeZoneNoIANA timezone (e.g., Europe/Prague). Default: UTC
filtersNoArray of filters. Example: [{parameter:'browser',type:'equals',value:['Chrome']},{parameter:'country',type:'equals',value:['US','DE']}]
pastMinutesStartNoAlternative to dates: minutes ago start (e.g., 60 = last hour)
pastMinutesEndNoAlternative to dates: minutes ago end (default 0 = now)

Implementation Reference

  • The handler implementation for the 'rybbit_get_retention' tool, which fetches cohort analysis data from the Rybbit API.
    async (args) => {
      try {
        const { siteId, ...rest } = args as {
          siteId: string;
          startDate?: string;
          endDate?: string;
          timeZone?: string;
          filters?: Array<{ parameter: string; type: string; value: (string | number)[] }>;
          pastMinutesStart?: number;
          pastMinutesEnd?: number;
        };
    
        const params = client.buildAnalyticsParams(rest);
    
        const data = await client.get<RetentionData[]>(
          `/sites/${siteId}/retention`,
          params
        );
    
        return {
          content: [
            {
              type: "text" as const,
              text: truncateResponse(data),
            },
          ],
        };
      } catch (err) {
        const message = err instanceof Error ? err.message : String(err);
        return {
          content: [{ type: "text" as const, text: `Error: ${message}` }],
          isError: true,
        };
      }
  • Registration of the 'rybbit_get_retention' tool, including its schema and metadata.
    server.registerTool(
      "rybbit_get_retention",
      {
        title: "User Retention",
        description:
          "Get user retention cohort analysis showing how many users return over time periods.",
        annotations: {
          readOnlyHint: true,
          idempotentHint: true,
          openWorldHint: true,
          destructiveHint: false,
        },
        inputSchema: {
          ...analyticsInputSchema,
        },
      },
Behavior3/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, covering safety and idempotency. The description adds the 'cohort analysis' conceptual context, indicating users are grouped and tracked over time, but does not disclose output format, pagination, rate limits, or how cohort periods are calculated (daily, weekly, etc.).

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?

The description is a single, efficient sentence of 12 words that front-loads the action ('Get') and subject ('user retention cohort analysis'). There is no redundant or wasted text.

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

Completeness3/5

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

Given the tool's complexity (7 parameters including complex filter arrays) and lack of output schema, the description is minimally adequate. It explains the analytical concept but omits critical details like the return value structure (matrix format, period granularity) or how retention is calculated (percentage vs. raw counts).

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

Parameters3/5

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

With 100% schema description coverage, the baseline is met. The description implies time-based analysis ('over time periods') which loosely maps to the date parameters, but does not explain parameter interactions (e.g., startDate vs. pastMinutesStart mutual exclusivity) or provide guidance on filter construction beyond the schema itself.

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 clearly states it retrieves a 'user retention cohort analysis' and specifies the output shows 'how many users return over time periods.' However, it does not explicitly differentiate this from sibling analytics tools like rybbit_get_metric or rybbit_get_user_event_breakdown, which also track user behavior.

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?

The description provides no guidance on when to use this tool versus alternatives (e.g., rybbit_get_overview for snapshots vs. cohort analysis for retention tracking), nor does it mention prerequisites like requiring a valid siteId or the mutual exclusivity of date ranges versus pastMinutes parameters.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nks-hub/rybbit-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server