Session Locations
rybbit_get_session_locationsRetrieve geographic session data with coordinates for map visualization and location analysis. Specify site, date range, and filters to get latitude, longitude, city, and country information.
Instructions
Get geographic session location data with coordinates. Returns latitude, longitude, city, country, and session count for map visualization and geographic analysis.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| siteId | Yes | Site ID (numeric ID or domain identifier) | |
| startDate | No | Start date in ISO format (YYYY-MM-DD) | |
| endDate | No | End date in ISO format (YYYY-MM-DD) | |
| timeZone | No | IANA timezone (e.g., Europe/Prague). Default: UTC | |
| filters | No | Array of filters. Example: [{parameter:'browser',type:'equals',value:['Chrome']},{parameter:'country',type:'equals',value:['US','DE']}] | |
| pastMinutesStart | No | Alternative to dates: minutes ago start (e.g., 60 = last hour) | |
| pastMinutesEnd | No | Alternative to dates: minutes ago end (default 0 = now) | |
| 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/overview.ts:184-208 (handler)The handler function for 'rybbit_get_session_locations' tool. It constructs parameters and calls the Rybbit client to fetch session location data.
async (args) => { try { const params = client.buildAnalyticsParams(args); const data = await client.get( `/sites/${args.siteId}/session-locations`, 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/overview.ts:167-183 (registration)Registration of the 'rybbit_get_session_locations' tool with the MCP server, including its schema, title, description, and annotations.
server.registerTool( "rybbit_get_session_locations", { title: "Session Locations", description: "Get geographic session location data with coordinates. Returns latitude, longitude, city, country, and session count for map visualization and geographic analysis.", inputSchema: { ...analyticsInputSchema, ...paginationSchema, }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, },