list_users
Retrieve all enrolled users in an Ed Discussion course using the course ID. This tool provides staff and administrators with access to course participant lists.
Instructions
List all users enrolled in a course (requires staff/admin)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| course_id | Yes | Course ID |
Implementation Reference
- src/api.ts:279-284 (handler)The implementation of the listUsers API call which performs the actual data fetching.
async listUsers(courseId: number): Promise<EdAnalyticsUser[]> { const res = await this.request<{ users: EdAnalyticsUser[] }>( "GET", `courses/${courseId}/analytics/users` ); return res.users; - src/index.ts:409-419 (registration)The registration of the 'list_users' tool, including input validation and calling the API handler.
server.tool( "list_users", "List all users enrolled in a course (requires staff/admin)", { course_id: z.number().describe("Course ID") }, async ({ course_id }) => { try { return ok(await api.listUsers(course_id)); } catch (err) { return fail(err); } }