Skip to main content
Glama
nks-hub

rybbit-mcp

by nks-hub

User Event Breakdown

rybbit_get_user_event_breakdown
Read-onlyIdempotent

Analyze individual user behavior by retrieving event count breakdowns for specific users, showing how many times each event was triggered during a defined period.

Instructions

Get event count breakdown for a specific user. Shows how many times each event_name was triggered by this user. Accepts either the Rybbit user_id (device hash) or the identified_user_id (app-provided user ID). Useful for analyzing per-user behavior like ad_click, chat_message_sent, etc.

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)
userIdYesUser ID — either Rybbit device hash (user_id) or app-provided ID (identified_user_id). Both are checked.

Implementation Reference

  • The tool `rybbit_get_user_event_breakdown` is registered and implemented directly in this block. It handles user filtering and fetches event breakdown data from the analytics API.
    server.registerTool(
      "rybbit_get_user_event_breakdown",
      {
        title: "User Event Breakdown",
        annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true, destructiveHint: false },
        description:
          "Get event count breakdown for a specific user. Shows how many times each event_name was triggered by this user. " +
          "Accepts either the Rybbit user_id (device hash) or the identified_user_id (app-provided user ID). " +
          "Useful for analyzing per-user behavior like ad_click, chat_message_sent, etc.",
        inputSchema: {
          ...analyticsInputSchema,
          userId: z.string().describe("User ID — either Rybbit device hash (user_id) or app-provided ID (identified_user_id). Both are checked."),
        },
      },
      async (args) => {
        try {
          // Build filters with user_id (backend checks both user_id and identified_user_id)
          const userFilter: FilterParam = {
            parameter: "user_id",
            type: "equals",
            value: [args.userId],
          };
          const filters = [...(args.filters ?? []), userFilter];
          const safeArgs = { ...args, filters };
    
          // Fetch event names endpoint — it already returns counts per event_name,
          // and the user_id filter will scope it to this user.
          const params = client.buildAnalyticsParams(safeArgs);
          const data = await client.get(`/sites/${args.siteId}/events/names`, 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,
          };
        }
      }
    );
Behavior4/5

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

Complements the annotations well by adding critical behavioral context not in the schema: that the tool accepts both 'Rybbit user_id (device hash)' and 'identified_user_id (app-provided user ID)'. It also describes the expected return structure (event name counts) since no output schema exists, without contradicting the readOnly/idempotent annotations.

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, all earning their place. Front-loaded with the core operation ('Get event count breakdown'), followed by output description, ID handling specifics, and use-case examples. No redundant or filler text.

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?

Given the lack of output schema, the description appropriately describes what data is returned (count breakdown by event_name). It covers the critical userId nuance and provides examples. With good annotations handling safety/readOnly aspects, the description provides sufficient context for invocation, though it could briefly acknowledge the date range parameters.

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?

With 100% schema description coverage, the baseline is 3. The description adds value by clarifying the dual-identity semantics of the userId parameter (accepts both device hash and app-provided ID), which helps the agent understand how to populate this required field correctly beyond the schema's technical description.

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?

The description clearly states the specific action ('Get event count breakdown'), the target resource ('for a specific user'), and the output format ('how many times each event_name was triggered'). It distinguishes from siblings like rybbit_list_events by emphasizing the aggregation/breakdown nature rather than raw event listing.

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?

Provides implied usage through examples ('Useful for analyzing per-user behavior like ad_click, chat_message_sent'), giving the agent context about when this tool applies. However, it lacks explicit guidance on when to use this versus rybbit_list_events or rybbit_get_event_timeseries, and does not state prerequisites or exclusions.

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