get_user_usage
Retrieve usage statistics for a specific user within defined time periods to monitor analytics activity and track user engagement patterns.
Instructions
Get usage statistics for a specific user (admin only)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | User UUID | |
| startAt | No | Start timestamp in milliseconds | |
| endAt | No | End timestamp in milliseconds |
Implementation Reference
- src/tools/users.ts:104-119 (handler)The handler implementation for the 'get_user_usage' tool, including its schema registration and API call logic.
server.tool( "get_user_usage", "Get usage statistics for a specific user (admin only)", { userId: z.string().describe("User UUID"), startAt: z.number().optional().describe("Start timestamp in milliseconds"), endAt: z.number().optional().describe("End timestamp in milliseconds"), }, async ({ userId, startAt, endAt }) => { const data = await client.call("GET", `/api/users/${userId}/usage`, undefined, { startAt, endAt, }); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } );