Skip to main content
Glama

get_students

Retrieve enrolled student lists from 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 logic: calls Moodle's core_enrol_get_enrolled_users API, filters users with student role, maps to student details, and returns formatted JSON response.
    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:128-136 (registration)
    Tool registration in the ListTools response: defines name, description, and empty input schema (no parameters required).
    {
      name: 'get_students',
      description: 'Obtiene la lista de estudiantes inscritos en el curso configurado',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
    },
  • src/index.ts:243-244 (registration)
    Dispatch case in CallToolRequest handler that routes 'get_students' calls to the getStudents() method.
    case 'get_students':
      return await this.getStudents();
  • Type definition for Student used in the getStudents handler output.
    interface Student {
      id: number;
      username: string;
      firstname: string;
      lastname: string;
      email: string;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral information. It states it retrieves a list but doesn't disclose pagination behavior, authentication requirements, rate limits, error conditions, or what 'curso configurado' means operationally. The description doesn't contradict annotations (none exist), but provides inadequate behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Spanish that states the core purpose. It's appropriately concise for a simple retrieval operation, though it could potentially be more front-loaded with key behavioral information given the lack of annotations.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations, no output schema, and minimal description, this is incomplete. The description doesn't explain what format the student list returns, what fields are included, whether it's paginated, or how 'curso configurado' is determined. Given the complexity of student data retrieval, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters with 100% schema description coverage, so the schema already fully documents the parameter situation. The description appropriately doesn't discuss parameters since none exist, earning a baseline score of 4 for zero-parameter tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('obtiene' - gets/retrieves) and resource ('lista de estudiantes inscritos en el curso configurado' - list of students enrolled in the configured course). It's specific about what it retrieves, though it doesn't explicitly differentiate from sibling tools like get_assignments or get_submissions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention prerequisites, context for 'curso configurado' (configured course), or how this differs from other student-related operations that might exist in the system.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/peancor/moodle-mcp-server'

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