User Journeys
rybbit_get_journeysAnalyzes user navigation paths through a site, showing sequences of pages visited and session counts per path to identify common user flows.
Instructions
Get user journey (flow) analysis showing the most common navigation paths through the site. Shows sequences of pages users visit and how many sessions follow each path.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| siteId | Yes | Site ID (numeric ID or domain identifier) | |
| startDate | No | Start date (YYYY-MM-DD) | |
| endDate | No | End date (YYYY-MM-DD) | |
| timeZone | No | IANA timezone (default UTC) | |
| filters | No | Filters to apply | |
| pastMinutesStart | No | Minutes ago start | |
| pastMinutesEnd | No | Minutes ago end | |
| steps | No | Number of journey steps to analyze (default 3) | |
| journeyLimit | No | Max number of journey paths to return (default 100) |
Implementation Reference
- src/tools/journeys.ts:69-107 (handler)The handler function for rybbit_get_journeys. It destructures args (siteId, steps, journeyLimit, plus analytics params), builds query params via client.buildAnalyticsParams(), calls client.get() on /sites/{siteId}/journeys, and returns the response or an error.
async (args) => { try { const { siteId, steps, journeyLimit, ...rest } = args as { siteId: string; steps?: number; journeyLimit?: number; startDate?: string; endDate?: string; timeZone?: string; filters?: Array<{ parameter: string; type: string; value: (string | number)[]; }>; pastMinutesStart?: number; pastMinutesEnd?: number; }; const params = client.buildAnalyticsParams(rest); if (steps !== undefined) params.steps = steps; if (journeyLimit !== undefined) params.limit = journeyLimit; const data = await client.get<JourneyPath[]>( `/sites/${siteId}/journeys`, 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, }; } } ); - src/tools/journeys.ts:29-67 (schema)Input schema (inputSchema) for rybbit_get_journeys. Defines siteId, startDate, endDate, timeZone, filters, pastMinutesStart, pastMinutesEnd, steps (2-10, default 3), and journeyLimit.
inputSchema: { siteId: siteIdSchema, startDate: z .string() .optional() .describe("Start date (YYYY-MM-DD)"), endDate: z .string() .optional() .describe("End date (YYYY-MM-DD)"), timeZone: z .string() .optional() .describe("IANA timezone (default UTC)"), filters: z .array(filterSchema) .optional() .describe("Filters to apply"), pastMinutesStart: z .number() .optional() .describe("Minutes ago start"), pastMinutesEnd: z .number() .optional() .describe("Minutes ago end"), steps: z .number() .int() .min(2) .max(10) .optional() .describe("Number of journey steps to analyze (default 3)"), journeyLimit: z .number() .int() .optional() .describe("Max number of journey paths to return (default 100)"), }, - src/tools/journeys.ts:13-108 (registration)Registration function registerJourneysTools which calls server.registerTool with the name 'rybbit_get_journeys', schema metadata, and handler. Called from src/index.ts line 48.
export function registerJourneysTools( server: McpServer, client: RybbitClient ): void { server.registerTool( "rybbit_get_journeys", { title: "User Journeys", description: "Get user journey (flow) analysis showing the most common navigation paths through the site. Shows sequences of pages users visit and how many sessions follow each path.", annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true, destructiveHint: false, }, inputSchema: { siteId: siteIdSchema, startDate: z .string() .optional() .describe("Start date (YYYY-MM-DD)"), endDate: z .string() .optional() .describe("End date (YYYY-MM-DD)"), timeZone: z .string() .optional() .describe("IANA timezone (default UTC)"), filters: z .array(filterSchema) .optional() .describe("Filters to apply"), pastMinutesStart: z .number() .optional() .describe("Minutes ago start"), pastMinutesEnd: z .number() .optional() .describe("Minutes ago end"), steps: z .number() .int() .min(2) .max(10) .optional() .describe("Number of journey steps to analyze (default 3)"), journeyLimit: z .number() .int() .optional() .describe("Max number of journey paths to return (default 100)"), }, }, async (args) => { try { const { siteId, steps, journeyLimit, ...rest } = args as { siteId: string; steps?: number; journeyLimit?: number; startDate?: string; endDate?: string; timeZone?: string; filters?: Array<{ parameter: string; type: string; value: (string | number)[]; }>; pastMinutesStart?: number; pastMinutesEnd?: number; }; const params = client.buildAnalyticsParams(rest); if (steps !== undefined) params.steps = steps; if (journeyLimit !== undefined) params.limit = journeyLimit; const data = await client.get<JourneyPath[]>( `/sites/${siteId}/journeys`, 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, }; } } ); } - src/tools/journeys.ts:13-108 (handler)The complete registerJourneysTools function containing registration, schema, and handler logic for rybbit_get_journeys.
export function registerJourneysTools( server: McpServer, client: RybbitClient ): void { server.registerTool( "rybbit_get_journeys", { title: "User Journeys", description: "Get user journey (flow) analysis showing the most common navigation paths through the site. Shows sequences of pages users visit and how many sessions follow each path.", annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true, destructiveHint: false, }, inputSchema: { siteId: siteIdSchema, startDate: z .string() .optional() .describe("Start date (YYYY-MM-DD)"), endDate: z .string() .optional() .describe("End date (YYYY-MM-DD)"), timeZone: z .string() .optional() .describe("IANA timezone (default UTC)"), filters: z .array(filterSchema) .optional() .describe("Filters to apply"), pastMinutesStart: z .number() .optional() .describe("Minutes ago start"), pastMinutesEnd: z .number() .optional() .describe("Minutes ago end"), steps: z .number() .int() .min(2) .max(10) .optional() .describe("Number of journey steps to analyze (default 3)"), journeyLimit: z .number() .int() .optional() .describe("Max number of journey paths to return (default 100)"), }, }, async (args) => { try { const { siteId, steps, journeyLimit, ...rest } = args as { siteId: string; steps?: number; journeyLimit?: number; startDate?: string; endDate?: string; timeZone?: string; filters?: Array<{ parameter: string; type: string; value: (string | number)[]; }>; pastMinutesStart?: number; pastMinutesEnd?: number; }; const params = client.buildAnalyticsParams(rest); if (steps !== undefined) params.steps = steps; if (journeyLimit !== undefined) params.limit = journeyLimit; const data = await client.get<JourneyPath[]>( `/sites/${siteId}/journeys`, 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, }; } } ); }