list_user_activity
Retrieve a user's recent threads and comments in a course to monitor participation and engagement.
Instructions
List a user's recent threads and comments in a course
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | Yes | User ID | |
| course_id | Yes | Course ID | |
| limit | No | Max items | |
| offset | No | Pagination offset | |
| filter | No | all |
Implementation Reference
- src/api.ts:256-274 (handler)The actual API client implementation for listing user activity.
async listUserActivity( userId: number, courseId: number, opts: { limit?: number; offset?: number; filter?: string } = {} ): Promise<EdActivityItem[]> { const params: Record<string, string | number> = { courseID: courseId, }; if (opts.limit !== undefined) params.limit = opts.limit; if (opts.offset !== undefined) params.offset = opts.offset; if (opts.filter) params.filter = opts.filter; const res = await this.request<{ items: EdActivityItem[] }>( "GET", `users/${userId}/profile/activity`, undefined, params ); return res.items ?? []; - src/index.ts:423-436 (registration)The tool registration and handler wrapper for `list_user_activity`.
"list_user_activity", "List a user's recent threads and comments in a course", { user_id: z.number().describe("User ID"), course_id: z.number().describe("Course ID"), limit: z.number().min(1).max(50).default(30).describe("Max items"), offset: z.number().min(0).default(0).describe("Pagination offset"), filter: z.enum(["all", "thread", "answer", "comment"]).default("all"), }, async ({ user_id, course_id, limit, offset, filter }) => { try { return ok(await api.listUserActivity(user_id, course_id, { limit, offset, filter })); } catch (err) { return fail(err);