Skip to main content
Glama

get_assignments

Retrieve a list of assignments from a configured Moodle course using this MCP server tool, enabling streamlined course management and task tracking.

Instructions

Obtiene la lista de tareas asignadas en el curso configurado

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "required": [], "type": "object" }

Implementation Reference

  • The handler function `getAssignments()` that fetches assignments from the Moodle API using the `mod_assign_get_assignments` web service and returns the list as a JSON-formatted text content block.
    private async getAssignments() { console.error('[API] Requesting assignments'); const response = await this.axiosInstance.get('', { params: { wsfunction: 'mod_assign_get_assignments', courseids: [MOODLE_COURSE_ID], }, }); const assignments = response.data.courses[0]?.assignments || []; return { content: [ { type: 'text', text: JSON.stringify(assignments, null, 2), }, ], }; }
  • Input schema for the `get_assignments` tool, defined as an empty object with no properties or requirements.
    inputSchema: { type: 'object', properties: {}, required: [], },
  • src/index.ts:137-145 (registration)
    Tool registration in the `ListToolsRequestSchema` handler, including name, description, and input schema.
    { name: 'get_assignments', description: 'Obtiene la lista de tareas asignadas en el curso configurado', inputSchema: { type: 'object', properties: {}, required: [], }, },
  • src/index.ts:245-246 (registration)
    Dispatch registration in the `CallToolRequestSchema` switch statement that routes calls to `getAssignments()`.
    case 'get_assignments': return await this.getAssignments();
  • TypeScript interface `Assignment` defining the structure of assignment objects returned by the tool.
    interface Assignment { id: number; name: string; duedate: number; allowsubmissionsfromdate: number; grade: number; timemodified: number; cutoffdate: number; }

Other Tools

Related 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