active-user-series
Track active user trends over time by retrieving time-series data in daily, weekly, or monthly intervals from Hackle-MCP. Analyze engagement patterns efficiently.
Instructions
Retrieves time-series data of active users. 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:170-180 (handler)The handler function for the 'active-user-series' tool. It takes unit and date parameters, builds a query string, calls WebClient.get to fetch time-series data from the specific API endpoint, stringifies the response as JSON, and returns it as text content.const qs = stringify({ unit, date }, { addQueryPrefix: true }); return { content: [ { type: 'text', text: JSON.stringify(await WebClient.get(`/api/v1/workspaces/auto-metrics/active-user-series${qs}`)), }, ], }; },
- src/index.ts:166-169 (schema)Zod input schema defining parameters for the tool: 'unit' as enum ['DAY', 'WEEK', 'MONTH'] and optional 'date' string.unit: z.enum(['DAY', 'WEEK', 'MONTH']), date: z.string().optional().describe('End date in YYYY-MM-DD format.'), }, async ({ unit = 'DAY', date = '' }) => {
- src/index.ts:163-181 (registration)Registration of the 'active-user-series' tool using server.tool(), including name, description, input schema, and handler function.'active-user-series', 'Retrieves time-series data of active users. 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/active-user-series${qs}`)), }, ], }; }, );