Skip to main content
Glama

get_students

Retrieve enrolled student lists from configured Moodle courses to manage class rosters and track participation.

Instructions

Obtiene la lista de estudiantes inscritos en el curso configurado

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the 'get_students' tool. It queries the Moodle API with core_enrol_get_enrolled_users, filters users with 'student' role, maps to Student fields, and returns JSON stringified list.
    private async getStudents() { console.error('[API] Requesting enrolled users'); const response = await this.axiosInstance.get('', { params: { wsfunction: 'core_enrol_get_enrolled_users', courseid: MOODLE_COURSE_ID, }, }); const students = response.data .filter((user: any) => user.roles.some((role: any) => role.shortname === 'student')) .map((student: any) => ({ id: student.id, username: student.username, firstname: student.firstname, lastname: student.lastname, email: student.email, })); return { content: [ { type: 'text', text: JSON.stringify(students, null, 2), }, ], }; }
  • src/index.ts:129-136 (registration)
    Registration of the 'get_students' tool in the ListToolsRequestSchema handler, including name, description, and input schema.
    name: 'get_students', description: 'Obtiene la lista de estudiantes inscritos en el curso configurado', inputSchema: { type: 'object', properties: {}, required: [], }, },
  • Input schema for 'get_students' tool: an empty object with no required properties.
    inputSchema: { type: 'object', properties: {}, required: [], },
  • src/index.ts:243-244 (registration)
    Dispatch/registration of 'get_students' tool call in the switch statement of CallToolRequestSchema handler.
    case 'get_students': return await this.getStudents();
  • TypeScript interface defining the Student data structure used in the getStudents handler output.
    interface Student { id: number; username: string; firstname: string; lastname: string; email: string; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cfsandoval/Mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server