Skip to main content
Glama

get_quizzes

Retrieve available quizzes from a configured Moodle course to access assessment materials and manage learning activities.

Instructions

Obtiene la lista de quizzes en el curso configurado

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'get_quizzes' tool. It calls the Moodle Web Service 'mod_quiz_get_quizzes_by_courses' for the configured course and returns the list of quizzes as a JSON-formatted text response.
    private async getQuizzes() {
      console.error('[API] Requesting quizzes');
      
      const response = await this.axiosInstance.get('', {
        params: {
          wsfunction: 'mod_quiz_get_quizzes_by_courses',
          courseids: [MOODLE_COURSE_ID],
        },
      });
    
      const quizzes = response.data.quizzes || [];
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(quizzes, null, 2),
          },
        ],
      };
    }
  • src/index.ts:146-154 (registration)
    Tool registration in the ListTools response, including name, description, and empty input schema (no parameters required).
    {
      name: 'get_quizzes',
      description: 'Obtiene la lista de quizzes en el curso configurado',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
    },
  • src/index.ts:247-248 (registration)
    Dispatch case in the CallToolRequest handler that routes 'get_quizzes' calls to the getQuizzes() method.
    case 'get_quizzes':
      return await this.getQuizzes();
  • TypeScript interface defining the structure of Quiz objects returned by the tool.
    interface Quiz {
      id: number;
      name: string;
      timeopen: number;
      timeclose: number;
      grade: number;
      timemodified: number;
    }

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