Funnel Step Sessions
rybbit_get_funnel_step_sessionsRetrieve user sessions that reached or dropped off at a specific funnel step to analyze drop-off causes and optimize conversion paths.
Instructions
Get the sessions that reached (or dropped off at) a specific funnel step. Useful for drilling into why users drop off at a particular funnel step.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| siteId | Yes | Site ID (numeric ID or domain identifier) | |
| stepNumber | Yes | The funnel step number to get sessions for (1-indexed) | |
| mode | Yes | 'reached' = sessions that made it to this step, 'dropped' = sessions that dropped off at this step | |
| 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 | Yes | The funnel steps definition (same as used in rybbit_analyze_funnel) | |
| page | No | Page number, 1-indexed (default: 1) | |
| limit | No | Results per page (default: 20-50 depending on endpoint, max 200) |
Implementation Reference
- src/tools/funnels.ts:222-256 (handler)The handler for `rybbit_get_funnel_step_sessions` performs the API call to fetch funnel step sessions.
async (args) => { try { const { siteId, stepNumber, mode, steps, ...rest } = args as { siteId: string; stepNumber: number; mode: "reached" | "dropped"; steps: FunnelStep[]; startDate?: string; endDate?: string; timeZone?: string; filters?: Array<{ parameter: string; type: string; value: (string | number)[]; }>; pastMinutesStart?: number; pastMinutesEnd?: number; page?: number; limit?: number; }; const params = client.buildAnalyticsParams({ ...rest, page: rest.page ?? 1 }); params.mode = mode; const data = await client.post( `/sites/${siteId}/funnels/${stepNumber}/sessions`, { steps }, params ); return { content: [{ type: "text" as const, text: truncateResponse(data) }], }; } catch (err) { const message = err instanceof Error ? err.message : String(err); return { - src/tools/funnels.ts:160-221 (registration)Registration of the `rybbit_get_funnel_step_sessions` tool, including its schema definition.
server.registerTool( "rybbit_get_funnel_step_sessions", { title: "Funnel Step Sessions", description: "Get the sessions that reached (or dropped off at) a specific funnel step. Useful for drilling into why users drop off at a particular funnel step.", annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true, destructiveHint: false, }, inputSchema: { siteId: siteIdSchema, stepNumber: z .number() .int() .min(1) .describe("The funnel step number to get sessions for (1-indexed)"), mode: z .enum(["reached", "dropped"]) .describe("'reached' = sessions that made it to this step, 'dropped' = sessions that dropped off at this step"), 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 .array( z.object({ value: z.string().describe("Page path or event name"), type: z.enum(["page", "event"]).describe("Step type"), name: z .string() .optional() .describe("Display name for the step"), }) ) .min(2) .describe("The funnel steps definition (same as used in rybbit_analyze_funnel)"), ...paginationSchema, }, },