retention-series
Retrieve time-series user retention data in daily, weekly, or monthly units using the specified end date in YYYY-MM-DD format. Analyze retention trends for informed decision-making.
Instructions
Retrieves time-series data of user retention. Available in daily, weekly, and monthly units.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | End date in YYYY-MM-DD format. | |
| unit | Yes |
Implementation Reference
- src/index.ts:191-202 (handler)The handler function that takes unit and date parameters, builds a query string, calls WebClient.get to fetch retention series data from the '/api/v1/workspaces/auto-metrics/retention-series' endpoint, stringifies the JSON response, and returns it as text content.async ({ unit = 'DAY', date = '' }) => { const qs = stringify({ unit, date }, { addQueryPrefix: true }); return { content: [ { type: 'text', text: JSON.stringify(await WebClient.get(`/api/v1/workspaces/auto-metrics/retention-series${qs}`)), }, ], }; },
- src/index.ts:187-190 (schema)Zod input schema defining the parameters: unit (required enum: DAY, WEEK, MONTH, default DAY) and optional date string.{ unit: z.enum(['DAY', 'WEEK', 'MONTH']), date: z.string().optional().describe('End date in YYYY-MM-DD format.'), },
- src/index.ts:184-203 (registration)The server.tool registration call that defines and registers the 'retention-series' tool with its description, input schema, and handler function.server.tool( 'retention-series', 'Retrieves time-series data of user retention. Available in daily, weekly, and monthly units.', { unit: z.enum(['DAY', 'WEEK', 'MONTH']), date: z.string().optional().describe('End date in YYYY-MM-DD format.'), }, async ({ unit = 'DAY', date = '' }) => { const qs = stringify({ unit, date }, { addQueryPrefix: true }); return { content: [ { type: 'text', text: JSON.stringify(await WebClient.get(`/api/v1/workspaces/auto-metrics/retention-series${qs}`)), }, ], }; }, );