moodle-mcp
v0.6.0Moodle MCP server for teachers: review assignment submissions, grade and give feedback; SSO login
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
moodle_site_info
Who I am on the Moodle site and what the site is: user name and id, site name and Moodle version, version of this MCP server. missingFunctions lists API functions the token does not grant (tools that need them will fail). uploadFiles tells whether the token's service allows file uploads (needed for images in moodle_save_grade; null — the site did not say). Start here if it is unclear whether the connection works.
moodle_search_participants
Find enrolled participants by partial name in one course. Returns userId and fullname. Present ambiguous matches to the teacher before selecting a user.
| Parameter | Type | Description |
|---|---|---|
courseId * | integer | Course id (from moodle_list_courses or the course/view.php?id=… URL) |
query * | string | |
page | integer | |
pageSize | integer |
moodle_list_courses
My courses on the Moodle site (where I am enrolled, including as a teacher): id, short and full name, dates, visibility. The course id is needed for moodle_list_assignments.
moodle_get_participant_progress
Course gradebook for one participant, including course totals. Distinguishes an ungraded item, a scored zero and passing the configured threshold. A missing pass threshold is reported explicitly. Grades reflect the teacher view.
| Parameter | Type | Description |
|---|---|---|
courseId * | integer | Course id (from moodle_list_courses or the course/view.php?id=… URL) |
userId * | integer | Participant id (userId from moodle_list_submissions) |
moodle_get_course_contents
Course outline in Moodle display order. Returns sections, activities, visibility, links, cmid and instanceId. Visibility restrictions can depend on the viewer.
| Parameter | Type | Description |
|---|---|---|
courseId * | integer | Course id (from moodle_list_courses or the course/view.php?id=… URL) |
moodle_get_page
Read a Page activity by cmid, including text, labelled link targets and attached files for moodle_download_file.
| Parameter | Type | Description |
|---|---|---|
cmid * | integer | Course module id (id from the activity URL or cmid from moodle_get_course_contents). |
moodle_get_feedback_summary
Feedback activity analysis by cmid. Returns completion count and aggregate choice counts, including rated multiple-choice questions. Omits individual responses and free text.
| Parameter | Type | Description |
|---|---|---|
cmid * | integer | Course module id (id from the activity URL or cmid from moodle_get_course_contents). |
moodle_compare_course_materials
Compare a source course with its copy in display order. Reports differences by section number and activity position (insertions or moves can shift subsequent comparisons). Compares titles, visibility, assignment dates and Page link labels/targets. sourceLabel flags old cohort text in target titles even when identical to the source. Reads no submissions.
| Parameter | Type | Description |
|---|---|---|
sourceCourseId * | integer | Course id (from moodle_list_courses or the course/view.php?id=… URL) |
targetCourseId * | ||
sourceLabel | string |
moodle_compare_submission_attempts
Compare two stored Moodle attempts for one participant. Defaults to the latest and its nearest available predecessor. Returns edits to plain online text, previous feedback and attachment changes. verifyFiles streams matching files to compare SHA-256; otherwise equal-sized files have unverified content. In-place edits have no history unless Moodle stored separate attempts.
| Parameter | Type | Description |
|---|---|---|
assignmentId * | integer | Assignment id from moodle_list_assignments (the id field, NOT the cmid from the mod/assign/view.php?id=… URL) |
userId * | integer | Participant id (userId from moodle_list_submissions) |
fromAttempt | integer | |
toAttempt | integer | |
verifyFiles | boolean |
moodle_preview_material_edit
Prepare an edit of an existing Page or Assignment through signed-in local Chrome. Stages files privately, returns original and proposed HTML, title, files and upload hashes. Show the teacher the changes before applying. The preview expires after 15 minutes.
| Parameter | Type | Description |
|---|---|---|
cmid * | integer | Course module id (id from the activity URL or cmid from moodle_get_course_contents). |
field * | string | Page content, activity description, or assignment additional files. |
html | string | Replace HTML in the selected editor. {{file:NAME}} refers to a file uploaded by this edit. |
name | string | |
remove | array | |
upload | array |
moodle_apply_material_edit
THE STUDENT WILL SEE changes to a visible activity. Apply one previously previewed edit only after explicit teacher confirmation of its text and files. A changed or consumed preview requires a new preview.
| Parameter | Type | Description |
|---|---|---|
previewId * | string |
moodle_get_assignment
Assignment details for one activity. Use the id from its browser URL. Returns the assignment id for grading, dates, description and attachments.
| Parameter | Type | Description |
|---|---|---|
cmid * | integer | Course module id (id from the activity URL or cmid from moodle_get_course_contents). |
moodle_list_assignments
Assignments of a course (Assignment activity, mod_assign): assignment id (needed by the other tools), cmid (the number from the mod/assign/view.php?id=… URL), name, allow submissions from / due / cut-off dates, grading (points with maximum or scale, grade to pass), submission types and assignment description.
| Parameter | Type | Description |
|---|---|---|
courseId * | integer | Course id (from moodle_list_courses or the course/view.php?id=… URL) |
brief | boolean | Only names, ids, URLs and dates. Skips descriptions, files and grade lookups. |
moodle_list_submissions
Assignment participants and their submission state: status (new: not submitted, draft: draft, submitted: submitted, reopened: new attempt opened), submission time, whether it needs grading by Moodle rules, current grade, and review. review is what the submission needs from the teacher, computed from the submission, grade and submission comment times (a teacher comment is one whose author is not the student): new_submission — submitted, no grade, no teacher reaction yet: review it; resubmitted — submitted again after a teacher comment or feedback (returned for rework or a previous attempt g…
| Parameter | Type | Description |
|---|---|---|
assignmentId * | integer | Assignment id from moodle_list_assignments (the id field, NOT the cmid from the mod/assign/view.php?id=… URL) |
status | string | Filter: all — everyone; submitted — submitted; needs_grading — submitted and awaiting grading by Moodle rules; graded — has a grade; not_submitted — not submitted; draft — draft; needs_att… |
moodle_list_pending_submissions
Submissions across all assignments of a course that need the teacher (or, with status=open, are not finished yet), in one call: assignment, participant, Moodle status, review, submission / grade / last comment times. With status=needs_grading, returns a fast list based only on Moodle’s requiregrading flag, with assignment and participant ids and names. review is what the submission needs from the teacher, computed from the submission, grade and submission comment times (a teacher comment is one whose author is not the student): new_submission — submitted, no grade, no teacher reaction yet:…
| Parameter | Type | Description |
|---|---|---|
courseId * | integer | Course id (from moodle_list_courses or the course/view.php?id=… URL) |
status | string | needs_attention — the teacher has to act; open — also submissions waiting for the student (awaiting_student, rework); needs_grading — fast Moodle grading queue without comment review |
moodle_get_submission
Full submission of one participant: status and attempt number, time, online text (as plain text), attached files (name, size, url for moodle_download_file), current grade, teacher feedback and submission comments (the conversation between the student and teachers; null if comments are unavailable for the assignment). commentsPartial flags an incomplete thread. Keep gradingState with the reviewed work for moodle_save_grade.
| Parameter | Type | Description |
|---|---|---|
assignmentId * | integer | Assignment id from moodle_list_assignments (the id field, NOT the cmid from the mod/assign/view.php?id=… URL) |
userId * | integer | Participant id (userId from moodle_list_submissions) |
attemptNumber | integer | Specific attempt; omit for latest. |
moodle_download_file
Downloads a submission file (or an assignment attachment) to the local disk and returns its path. fileUrl is the url field from moodle_get_submission or moodle_list_assignments. An existing file is not overwritten: " (1)" is appended to the name.
| Parameter | Type | Description |
|---|---|---|
destDir * | string | Absolute path of the directory to save to; created if missing |
fileUrl * | string | Moodle file URL (…/pluginfile.php/…) on this site |
moodle_download_submission_files
Download the attachments of one submission attempt. Returns local paths, byte sizes and SHA-256. Retry with the same destDir to verify and reuse completed files. The result keeps separate copies for changed or conflicting files.
| Parameter | Type | Description |
|---|---|---|
assignmentId * | integer | Assignment id from moodle_list_assignments (the id field, NOT the cmid from the mod/assign/view.php?id=… URL) |
destDir * | string | |
userId * | integer | Participant id (userId from moodle_list_submissions) |
attemptNumber | integer | |
expectedSubmission | string | gradingState.submission from the reviewed attempt |
moodle_save_grade
Saves a participant's grade for an assignment and writes feedback comments. THE STUDENT WILL SEE the grade and feedback (immediately, or after release if marking workflow is enabled) and may receive a notification. Call only after the teacher has explicitly confirmed the grade and the text. The grade is checked against the assignment maximum. Feedback is required: Moodle saves the grade and the feedback together, so the text replaces the previous feedback (and its images). images attaches local screenshots or pictures INSIDE the feedback text — THE STUDENT WILL SEE THEM: put them in the text…
| Parameter | Type | Description |
|---|---|---|
assignmentId * | integer | Assignment id from moodle_list_assignments (the id field, NOT the cmid from the mod/assign/view.php?id=… URL) |
expectedState * | object | Copy gradingState from the reviewed moodle_get_submission result before asking the teacher to confirm. |
feedback * | string | Feedback comments for the student; replaces the previous feedback |
grade * | number | Grade: points from 0 to the assignment maximum; for a scale, the item number from 1 |
userId * | integer | Participant id (userId from moodle_list_submissions) |
addAttempt | boolean | Open a new attempt for the student (if the assignment allows it) |
applyToAll | boolean | For group assignments, apply the grade to the whole group |
attemptNumber | integer | Attempt number; -1 means the latest |
feedbackFormat | string | feedback format: plain — plain text (paragraphs separated by a blank line), markdown, html |
images | array | Images to show inside the feedback, up to 5, each up to 2 MiB |
workflowState | string | Marking workflow state (if enabled): notmarked, inmarking, readyforreview, inreview, readyforrelease, released |
moodle_add_submission_comment
Adds a comment to a participant's submission (the comments thread under the submission, separate from feedback). THE STUDENT WILL SEE the comment and may receive a notification. Call only after the teacher has explicitly confirmed the text. Existing comments are in moodle_get_submission.
| Parameter | Type | Description |
|---|---|---|
assignmentId * | integer | Assignment id from moodle_list_assignments (the id field, NOT the cmid from the mod/assign/view.php?id=… URL) |
text * | string | Comment text, plain text |
userId * | integer | Participant id (userId from moodle_list_submissions) |
moodle_get_resubmission_window
Check one participant before returning work. Shows opening, due date, hard cut-off and personal extension. An open date window does not guarantee enrolment or activity access. If the participant is filtered out in Moodle, only assignment defaults can be shown.
| Parameter | Type | Description |
|---|---|---|
assignmentId * | integer | Assignment id from moodle_list_assignments (the id field, NOT the cmid from the mod/assign/view.php?id=… URL) |
userId * | integer | Participant id (userId from moodle_list_submissions) |
moodle_grant_extension
THE STUDENT WILL SEE the new personal due date. Only call after teacher confirmation of the participant, assignment and exact date. Use expectedExtensionDueAt from the window check (null if none). Verify before returning a group submission: this extension covers one person.
| Parameter | Type | Description |
|---|---|---|
assignmentId * | integer | Assignment id from moodle_list_assignments (the id field, NOT the cmid from the mod/assign/view.php?id=… URL) |
expectedExtensionDueAt * | ||
extensionDueAt * | string | |
userId * | integer | Participant id (userId from moodle_list_submissions) |
moodle_return_submission_with_reason
THE STUDENT WILL SEE the confirmed reason and the return to draft. Confirm both together, including the group when applicable. Copy expectedState from the reviewed submission. If interrupted, use resumeOnly with the same inputs to continue after an existing comment. Check commentId and status after partial results.
| Parameter | Type | Description |
|---|---|---|
assignmentId * | integer | Assignment id from moodle_list_assignments (the id field, NOT the cmid from the mod/assign/view.php?id=… URL) |
expectedState * | object | Copy gradingState from the reviewed moodle_get_submission result before asking the teacher to confirm. |
reason * | string | |
userId * | integer | Participant id (userId from moodle_list_submissions) |
confirmGroup | boolean | Set only after the teacher confirmed the return for the entire group. |
resumeOnly | boolean | Continue only if this teacher’s matching reason is already present for this revision. Never post another comment. |
verifiedWindowInMoodle | boolean | Teacher verified participant dates in Moodle after an unknown API result. |
moodle_revert_submission_to_draft
Returns a participant's submitted work for rework: the submission goes back to draft, the student can edit it and submit again while the assignment accepts submissions (due and cut-off dates or an extension). THE STUDENT WILL SEE the status change. The grade and feedback stay; for a group submission the whole group is affected. Use it when the assignment allows one attempt; explain the reason to the student with feedback or moodle_add_submission_comment. Call only after the teacher has explicitly confirmed.
| Parameter | Type | Description |
|---|---|---|
assignmentId * | integer | Assignment id from moodle_list_assignments (the id field, NOT the cmid from the mod/assign/view.php?id=… URL) |
userId * | integer | Participant id (userId from moodle_list_submissions) |
verifiedWindowInMoodle | boolean | Set only if the teacher verified the participant dates in Moodle after a filtered/unknown API result. |