Tools
moodle-mcp has 267 tools, 266 at the default privacy level. This page is generated from the server itself, so it lists them exactly as your AI app gets them, with the descriptions the agent reads. You don't call tools yourself: you ask in your own words, and the agent picks them.
In the tables, ✓ marks the tools you still get with each limit: Read only with read-only access, Teacher and Student with each role. Read-only access leaves out every tool that changes something in Moodle (a grade, a post, an activity, an attempt); session tools, such as logging in or showing the browser, are always there, and so are download_file and export_grades, which only save a file on your computer.
Session
| Tool | Description | Read only | Teacher | Student |
|---|---|---|---|---|
login | Log in to Moodle | ✓ | ✓ | ✓ |
logout | Log out of Moodle | ✓ | ✓ | ✓ |
get_me | Who am I | ✓ | ✓ | ✓ |
get_site_info | Get the Moodle site's info | ✓ | ✓ | ✓ |
configure | Configure the server | ✓ | ✓ | ✓ |
show_browser | Show or hide the browser | ✓ | ✓ | ✓ |
server_info | Server info | ✓ | ✓ | ✓ |
list_sites | List the Moodle sites | ✓ | ✓ | ✓ |
add_site | Add a Moodle site | ✓ | ✓ | ✓ |
use_site | Switch to another Moodle site | ✓ | ✓ | ✓ |
remove_site | Remove a Moodle site | ✓ | ✓ | ✓ |
login
Log in to Moodle
Make sure there is a Moodle session. If there is one, returns the logged-in user at once. Otherwise opens a browser window at the site's login page and waits until the person logs in there themselves (the server never sees their password), then returns the user. Call it when another tool reports a missing or expired session.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
timeoutSeconds | integer | How long to wait for the person to log in, in seconds (default 300) |
logout
Log out of Moodle
End the person's Moodle session in the server's browser, so someone else can log in (another account: login opens the window again). Only Moodle's session ends: a single sign-on provider may keep its own and log the same person back in. Only when the person asks.
No inputs.
get_me
Who am I
Tell who the logged-in person is: user id, username, full name, email, language, time zone, first and last access, and the site. With courseId, also their roles in that course and whether they can edit it and grade in it.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | integer | A course id (from list_courses) to also get the person's roles and abilities there |
get_site_info
Get the Moodle site's info
What the Moodle site says about itself: its name, URL, language, how people log in (its own form, guest access, single sign-on providers) and whether it's in maintenance; readable before logging in. With courseId, also the activity and resource types the person can add to that course (none if they can't edit it): take the type for create_activity from here. Moodle shows its version only to administrators, so it isn't given.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | integer | A course to list the activity types that can be added to it |
configure
Configure the server
Set this server's configuration for this session: the Moodle site (url; a new one is added to the server's sites and kept, a known one becomes active, see use_site), whether the browser runs without a window (headless), how student tools view and do things (trail) and the browser profile folder (profileDir). It can also narrow the kinds of tools (scopes), the role (role), access to read only (access) or the courses it works in (courses) and tighten how others' data reaches you (studentData), never the other way: widening is the person's, in the client's configuration. Each is optional; only those given change. The URL is checked to be a Moodle site. Kept in memory only, but for a new site, which stays among the server's sites. Returns the effective configuration, as server_info.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
url | string | The Moodle site's URL, or any page of it (a course URL works: the site is read from it) | |
headless | boolean | Run the browser without a window (logging in always shows one) | |
trail | realistic, fast | How student tools view and do things: realistic (real pages, human pace; Moodle logs views and completion) or fast | |
profileDir | string | Absolute folder for the browser profile that keeps the Moodle session; outside the server's folder | |
scopes | string | Narrow the kinds of tools for this session: a profile (teacher, student, content) or scopes (content, student-data, grading, communication, as-student, browser). Only fewer than now, never more | |
studentData | block, pseudonymize, clear | Tighten how others' data reaches you for this session (block is strictest). Only stricter than now, never looser | |
role | all, teacher, student | Keep only one role's tools for this session (teacher or student), from all; never back to all | |
access | read, write | read: keep only the tools that change nothing in Moodle for this session; never back to write | |
courses | string list | Keep the agent to these courses for this session, by URL (…/course/view.php?id=N), on the server's sites: among the classrooms the person set, if any (ADR-025) |
show_browser
Show or hide the browser
Show the browser to the person, so they can watch what the tools do: the window opens now (the session is kept) and each tool brings the Moodle page it works on to the front. Or hide it again: the window closes and tools go on without one. Only when the person asks to watch or to stop watching. Open tabs don't survive the switch; what was saved in Moodle does. Changes nothing in Moodle.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
visible | ✅ | boolean | true to show the browser and follow the tools in it, false to hide it |
server_info
Server info
Show this server's version and effective configuration: the active Moodle site and the others, the browser profile folder, the browser, and where each setting came from. Contains no secrets. Does not open the browser.
No inputs.
list_sites
List the Moodle sites
List the Moodle sites this server knows, by name: their URL, which one is active (every other tool works on it) and whether each comes from the person's configuration or was added at run time. Switch with use_site.
No inputs.
add_site
Add a Moodle site
Add a Moodle site to this server, kept for later sessions: its URL (any page of it works) and, optionally, a short name (letters, digits, dots, hyphens; its host by default). Without url, the person is asked for both in their app, where the client can ask them (MCP elicitation); else ask them yourself. Two accounts on one site are two sites: add the second with a name of its own. It doesn't become active: switch to it with use_site, and log in there when a tool asks. Only when the person asks for another site.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
url | string | The site's URL, or any page of it; without it, the person is asked in their app when it can | |
name | string | A short name for it; its host by default |
use_site
Switch to another Moodle site
Make another known site the active one, by name (list_sites): every other tool works on it from now on. The previous site's browser closes and keeps its session; if the new one has none, the next tool asks to log in. Tell the person which site you're now working on. Lasts for this session.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
name | ✅ | string | The site's name, as list_sites gives it |
remove_site
Remove a Moodle site
Forget a site added at run time, by name, and delete its browser profile with its session. Not the active site (switch first) nor one from the person's configuration (they remove it there). Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
name | ✅ | string | The site's name, as list_sites gives it |
Courses and content
| Tool | Description | Read only | Teacher | Student |
|---|---|---|---|---|
list_courses | List my courses | ✓ | ✓ | ✓ |
get_course_structure | Get a course's structure | ✓ | ✓ | ✓ |
get_activity_content | Read an activity's content | ✓ | ✓ | ✓ |
get_activity_settings | Get an activity's settings | ✓ | ✓ | |
download_file | Download a file from Moodle | ✓ | ✓ | ✓ |
create_activity | Create an activity or resource | ✓ | ||
update_activity | Update an activity's settings or content | ✓ | ||
validate_html | Check HTML before sending it to Moodle | ✓ | ✓ | ✓ |
edit_activity | Move, rename, show or hide an activity | ✓ | ||
duplicate_activity | Duplicate an activity | ✓ | ||
delete_activity | Delete an activity | ✓ | ||
add_section | Add a section | ✓ | ||
edit_section | Edit a section | ✓ | ||
delete_section | Delete a section | ✓ | ||
update_course | Update a course's settings | ✓ |
list_courses
List my courses
List the Moodle courses the logged-in person is enrolled in (as teacher or student), with their ids, names, category, URL, visibility, dates and, where Moodle tracks it, the person's progress: only as a student, in courses with completion tracking (a teacher gets none; students' progress is in get_completion_report). Filter by dates with classification.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
classification | all, inprogress, future, past | Which courses by their dates: "all" (default), "inprogress", "future" or "past" |
get_course_structure
Get a course's structure
Get a Moodle course's sections and activities: ids, names, types, URLs, visibility, whether the person can open each one, restrictions and, where Moodle tracks it, the person's completion: only as a student, on activities with completion tracking (a teacher gets none; students' completion is in get_completion_report). With details, also each activity's dates and restriction text as the course page shows them. Takes the course id from list_courses.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | The course's id, as list_courses gives it |
details | boolean | Also read the course page for each activity's dates and restriction text (slower; default false) |
get_activity_content
Read an activity's content
Read a content activity as a person would, so Moodle logs the view: a page's or label's text, a book's chapters, a URL resource's target, or a file resource's or folder's files (as links). Takes the id and type from get_course_structure. With the realistic trail it reads page by page at a reader's pace and reports progress.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The activity's id (course module id), as get_course_structure gives it |
type | ✅ | page, book, label, url, resource, folder | The activity's type, as get_course_structure gives it |
get_activity_settings
Get an activity's settings
Read every setting of an activity as its edit form holds them, without changing anything: its module, name, description, each field with its form name, label, value and options, a resource's, folder's or SCORM's files, and its access restrictions and completion in the terms update_activity takes. Use it before update_activity. Teachers only. Takes the activity id from get_course_structure.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The activity's id (course module id), as get_course_structure gives it |
download_file
Download a file from Moodle
Save a file of the Moodle site to a local folder, with the person's session: a resource's or folder's file (get_activity_content), an assignment's brief file or submitted file (get_assignment, get_submissions), a forum attachment (get_discussion). Only URLs of the configured site's host (its media too: videos it serves outside Moodle); external links (YouTube…) are for other tools. Never overwrites: an existing name gets a number. Returns where it was saved.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
url | ✅ | string | The file's URL on the site, as the other tools give it (…/pluginfile.php/…) |
destDir | ✅ | string | Absolute local folder to save into; created if missing |
create_activity
Create an activity or resource
Create an activity or resource of any type (page, label, url, resource, folder, assign, quiz, forum…) at the end of a section, through Moodle's own form, hidden from students by default. Common fields have their own inputs, access restrictions and completion included; any other setting goes in settings by its form field name. files are local paths uploaded to a file resource or folder, a SCORM's package (type scorm, the first file) or an H5P activity's package (type h5pactivity, a .h5p, deployed when it's first opened; its settings worth naming: enabletracking 1 or 0, grademethod 1 highest, 2 average, 3 last or 4 first attempt, grade[modgrade_point] the maximum grade; the package plays only if the site has its H5P content type). Returns the new activity's id and the course structure. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
sectionId | ✅ | integer | The section's id, as get_course_structure gives it |
type | ✅ | string | Moodle's module name: page, label, url, resource, folder, assign, quiz, forum, book… |
name | string | Required except for labels | |
files | string list | Absolute local paths: a file resource's file (the first is the main one), a folder's files, a SCORM's package (.zip), an H5P activity's package (.h5p) | |
toolId | integer | type lti: the external tool it's made from, as list_external_tools gives it (Moodle 5 makes LTI activities only from a tool) | |
description | string | The description (HTML), shown on the activity's page | |
content | string | A page's content, or a label's text (HTML) | |
url | string | A URL resource's target | |
visibility | shown, hidden, stealth | "stealth": hidden from the course page but available by link, where the site allows it | |
restrictions | object | When students can open it ({ conditions: [] } removes them) | |
completion | object | When it counts as complete | |
embed | string list | Absolute local files (images…) to embed in the HTML, which names each by its file name: <img src="shot.png"> | |
settings | object | Any other form field by its name in Moodle's activity form, e.g. {"duedate[enabled]": true, "duedate[day]": 12, "grade[modgrade_point]": 10} |
update_activity
Update an activity's settings or content
Change an existing activity through Moodle's own form: name, description, a page's or label's content, a URL's target, visibility, access restrictions, completion, a file resource's or folder's files (add, remove by their path as get_activity_settings lists them, or replace all), a SCORM's package (replaced in place: the activity keeps its id, settings and grade item; attempts stay in the SCOs the new package keeps, by their identifier, and go with the SCOs it drops), or any other setting by its form field name in settings. Only what is given changes. Returns the course structure, and a SCORM as get_scorm reads it after a new package. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The activity's id (course module id), as get_course_structure gives it |
name | string | ||
description | string | The description (HTML), shown on the activity's page | |
content | string | A page's content, or a label's text (HTML) | |
url | string | A URL resource's target | |
visibility | shown, hidden, stealth | "stealth": hidden from the course page but available by link, where the site allows it | |
restrictions | object | When students can open it ({ conditions: [] } removes them) | |
completion | object | When it counts as complete | |
embed | string list | Absolute local files (images…) to embed in the HTML, which names each by its file name: <img src="shot.png"> | |
settings | object | Any other form field by its name in Moodle's activity form, e.g. {"duedate[enabled]": true, "duedate[day]": 12, "grade[modgrade_point]": 10} | |
files | object | A file resource's or folder's files; untouched when missing | |
package | string | A SCORM's new package: an absolute local path to a .zip, replacing the current one in place |
validate_html
Check HTML before sending it to Moodle
Check HTML for a page, a label, a description or a post before sending it, without Moodle, and approximately: only Moodle knows exactly what its cleaning keeps. Reports, with their lines, parse errors and tags left open, what Moodle's cleaning removes (scripts, styles, frames, forms, event attributes such as onclick, javascript: links), files the HTML names that are neither URLs nor in embed, and embed files that don't exist or the HTML doesn't name. Give embed as you would to the content tool.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
text | string | The HTML | |
file | string | Or an absolute path to a local HTML file | |
embed | string list | The local files you'll embed, as the content tools take them |
edit_activity
Move, rename, show or hide an activity
Move an activity to another section (at its end) or before another activity, to reorder a course; rename it; or set its visibility ("shown", "hidden", or "stealth": hidden from the course page but available by link). Only what is given changes. Returns the course structure afterwards. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | The course's id, as list_courses gives it |
activityId | ✅ | integer | The activity's id (course module id), as get_course_structure gives it |
name | string | ||
visibility | shown, hidden, stealth | ||
sectionId | integer | Move it to the end of this section | |
beforeActivityId | integer | Move it before this activity (in that activity's section) |
duplicate_activity
Duplicate an activity
Duplicate an activity right after itself, with its settings and content (not participants' data). Returns the copy's id and the course structure. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | The course's id, as list_courses gives it |
activityId | ✅ | integer | The activity's id (course module id), as get_course_structure gives it |
delete_activity
Delete an activity
Delete an activity from a course, with its participants' data (submissions, attempts, posts, grades). Destructive: confirm with the person first, naming the activity. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | The course's id, as list_courses gives it |
activityId | ✅ | integer | The activity's id (course module id), as get_course_structure gives it |
add_section
Add a section
Add a section to a course, at the end or after a given section, optionally named and described. Returns its id and the course structure. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | The course's id, as list_courses gives it |
name | string | ||
summary | string | Its description (HTML) | |
embed | string list | Absolute local files (images…) to embed in the HTML, which names each by its file name: <img src="shot.png"> | |
afterSectionId | integer | Add it after this section; at the end when missing |
edit_section
Edit a section
Change a section: rename it, describe it, show or hide it (with its activities), restrict access to it, or move it after another section. Only what is given changes. Returns the course structure. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | The course's id, as list_courses gives it |
sectionId | ✅ | integer | A section's id (not its number), as get_course_structure gives it |
name | string | ||
visible | boolean | ||
summary | string | Its description (HTML) | |
embed | string list | Absolute local files (images…) to embed in the HTML, which names each by its file name: <img src="shot.png"> | |
restrictions | object | When students can open it ({ conditions: [] } removes them) | |
afterSectionId | integer | Move it after this section |
delete_section
Delete a section
Delete a section and every activity in it, with their participants' data. Destructive: confirm with the person first, saying which activities go with it. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | The course's id, as list_courses gives it |
sectionId | ✅ | integer | A section's id (not its number), as get_course_structure gives it |
update_course
Update a course's settings
Change a course's full name, short name, summary (HTML) or any other setting by its field name in Moodle's course settings form (settings), through that form. Only what is given changes. Returns the course afterwards. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
fullName | string | ||
shortName | string | ||
summary | string | HTML | |
embed | string list | Absolute local files (images…) to embed in the HTML, which names each by its file name: <img src="shot.png"> | |
settings | object | Other fields by their name in the course settings form, e.g. {"visible": 0, "startdate[day]": 1} |
Books, lessons, wikis, glossaries, databases and feedback
| Tool | Description | Read only | Teacher | Student |
|---|---|---|---|---|
list_book_chapters | List a book's chapters | ✓ | ✓ | |
add_book_chapter | Add a chapter to a book | ✓ | ||
edit_book_chapter | Change a book's chapter | ✓ | ||
move_book_chapter | Move a book's chapter up or down | ✓ | ||
set_book_chapter_visibility | Show or hide a book's chapter | ✓ | ||
delete_book_chapter | Delete a book's chapter | ✓ | ||
get_lesson_pages | Read a lesson's pages as its teacher | ✓ | ✓ | |
add_lesson_page | Add a page to a lesson | ✓ | ||
edit_lesson_page | Change a lesson's page | ✓ | ||
move_lesson_page | Move a lesson's page | ✓ | ||
delete_lesson_page | Delete a lesson's page | ✓ | ||
get_database_fields | Read a database's fields | ✓ | ✓ | |
add_database_field | Add a field to a database | ✓ | ||
edit_database_field | Change a database's field | ✓ | ||
delete_database_field | Delete a database's field | ✓ | ||
get_database_templates | Read a database's templates | ✓ | ✓ | |
set_database_template | Set a database's template | ✓ | ||
list_database_presets | List the presets for a database | ✓ | ✓ | |
apply_database_preset | Give a database a preset | ✓ | ||
list_database_entries | Read a database's entries | ✓ | ✓ | ✓ |
add_database_entry | Add an entry to a database | ✓ | ✓ | |
edit_database_entry | Change a database entry | ✓ | ✓ | |
delete_database_entry | Delete a database entry | ✓ | ✓ | |
set_database_entry_approved | Approve a database entry | ✓ | ||
export_database_entries | Export a database's entries to CSV | ✓ | ✓ | |
import_database_entries | Import entries into a database from CSV | ✓ | ||
list_glossary_entries | Read a glossary's entries | ✓ | ✓ | ✓ |
add_glossary_entry | Add an entry to a glossary | ✓ | ✓ | |
edit_glossary_entry | Change a glossary entry | ✓ | ✓ | |
delete_glossary_entry | Delete a glossary entry | ✓ | ✓ | |
set_glossary_entry_approved | Approve a glossary entry | ✓ | ||
list_glossary_categories | List a glossary's categories | ✓ | ✓ | ✓ |
add_glossary_category | Add a category to a glossary | ✓ | ||
export_glossary | Export a glossary's entries to a file | ✓ | ✓ | |
import_glossary | Import entries into a glossary | ✓ | ||
list_wiki_pages | List a wiki's pages | ✓ | ✓ | ✓ |
get_wiki_page | Read a wiki page | ✓ | ✓ | ✓ |
create_wiki_page | Create a wiki page | ✓ | ✓ | |
edit_wiki_page | Edit a wiki page | ✓ | ✓ | |
get_feedback_items | Read a feedback's questions | ✓ | ✓ | |
add_feedback_item | Add a question to a feedback | ✓ | ||
edit_feedback_item | Change a feedback's question | ✓ | ||
move_feedback_item | Move a feedback's question | ✓ | ||
delete_feedback_item | Delete a feedback's question | ✓ | ||
list_feedback_templates | List feedback templates | ✓ | ✓ | |
use_feedback_template | Use a template in a feedback | ✓ | ||
save_feedback_template | Save a feedback as a template | ✓ | ||
delete_feedback_template | Delete a feedback template | ✓ |
list_book_chapters
List a book's chapters
List a book's chapters in order: id, title, whether each is a subchapter or hidden, and its place; with content, each chapter's HTML and images too (one page read per chapter, logged by Moodle as a view). A teacher sees hidden chapters, a student doesn't. The chapter ids are what the other book tools take.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bookId | ✅ | integer | The book's id (course module id), as get_course_structure gives it |
content | boolean | Also each chapter's HTML and images |
add_book_chapter
Add a chapter to a book
Add a chapter to a book through Moodle's chapter form: its title and content (HTML, with local images embedded), at the end or after another chapter, as a subchapter of the chapter before it if asked, hidden if asked (shown by default, as Moodle adds it: hide it while the book is visible and the chapter isn't ready). Returns the new chapter's id and the chapters. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bookId | ✅ | integer | The book's id (course module id), as get_course_structure gives it |
title | ✅ | string | |
content | ✅ | string | Its content (HTML); Moodle requires some |
subchapter | boolean | A subchapter of the chapter before it (not for the first) | |
hidden | boolean | Hidden from students | |
afterChapterId | integer | The chapter it goes after; at the end without it | |
embed | string list | Absolute local files (images…) to embed in the content, which names each by its file name: <img src="shot.png"> |
edit_book_chapter
Change a book's chapter
Change a chapter's title, content (HTML, with local images embedded) or whether it is a subchapter, through its form: only what is given changes. move_book_chapter moves it, set_book_chapter_visibility shows or hides it. Returns the chapters afterwards. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bookId | ✅ | integer | The book's id (course module id), as get_course_structure gives it |
chapterId | ✅ | integer | The chapter's id, as list_book_chapters gives it |
title | string | ||
content | string | ||
subchapter | boolean | ||
embed | string list | Absolute local files (images…) to embed in the content, which names each by its file name: <img src="shot.png"> |
move_book_chapter
Move a book's chapter up or down
Move a chapter one place up or down, as the table of contents' arrows do: a chapter moves with its subchapters, past the whole chapter before or after it; a subchapter moves alone. Call it again to move further. Returns the chapters afterwards. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bookId | ✅ | integer | The book's id (course module id), as get_course_structure gives it |
chapterId | ✅ | integer | The chapter's id, as list_book_chapters gives it |
direction | ✅ | up, down |
set_book_chapter_visibility
Show or hide a book's chapter
Show a chapter to students or hide it from them, as the table of contents' eye does: a chapter's subchapters go with it, and a subchapter of a hidden chapter stays hidden. Returns the chapters afterwards. Changes what students see: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bookId | ✅ | integer | The book's id (course module id), as get_course_structure gives it |
chapterId | ✅ | integer | The chapter's id, as list_book_chapters gives it |
visible | ✅ | boolean |
delete_book_chapter
Delete a book's chapter
Delete a chapter with its files; deleting a chapter (not a subchapter) deletes its subchapters too. Returns the chapters afterwards. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bookId | ✅ | integer | The book's id (course module id), as get_course_structure gives it |
chapterId | ✅ | integer | The chapter's id, as list_book_chapters gives it |
get_lesson_pages
Read a lesson's pages as its teacher
Read a lesson's pages as its teacher has them in Moodle's lesson editor, in order: type (content, a question type, cluster, end of cluster, end of branch), title, contents, and a content page's buttons or a question's answers with their responses, scores and jumps (a page's id, or next-page, end-of-lesson…). Takes a teacher's role; a student plays a lesson with get_lesson_page.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
lessonId | ✅ | integer | The lesson's id (course module id), as get_course_structure gives it |
add_lesson_page
Add a page to a lesson
Add a page to a lesson through Moodle's lesson editor: a content page with its buttons, a question page (multichoice, truefalse, shortanswer, numerical, matching, essay) with its answers, responses, scores and jumps, or a cluster, end of cluster or end of branch; after a page, or last. A jump to a page the lesson doesn't have is refused before anything is saved, so add the pages first and set their jumps after with edit_lesson_page when they point forward. Returns the new page's id and the lesson's page ids in order. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
lessonId | ✅ | integer | The lesson's id (course module id), as get_course_structure gives it |
type | ✅ | content, multichoice, truefalse, shortanswer, numerical, matching, essay, cluster, end-of-cluster, end-of-branch | |
title | string | ||
contents | string | The page's contents (HTML); local files it names (<img src="shot.png">) go in embed | |
embed | string list | Absolute local files to embed in the contents, answers or responses | |
buttons | object list | A content page's buttons, in order; given, they replace them all | |
answers | object list | A question page's answers, in order (given, they replace them all); an essay or structural page's single row | |
multipleAnswers | boolean | Multichoice: more than one answer can be right | |
caseSensitive | boolean | Short answer: answers compared case-sensitively | |
fields | object | Any other field of the page's form, by name (layout, display…) | |
after | integer | The page it goes after (0: first); last without it |
edit_lesson_page
Change a lesson's page
Change a lesson's page through its form in the lesson editor: title, contents, buttons or answers (given, they replace them all), options and other fields; only what is given changes, and a page keeps its type. A jump to a page the lesson doesn't have is refused before anything is saved. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
lessonId | ✅ | integer | The lesson's id (course module id), as get_course_structure gives it |
pageId | ✅ | integer | The page's id, as get_lesson_pages gives it |
title | string | ||
contents | string | The page's contents (HTML); local files it names (<img src="shot.png">) go in embed | |
embed | string list | Absolute local files to embed in the contents, answers or responses | |
buttons | object list | A content page's buttons, in order; given, they replace them all | |
answers | object list | A question page's answers, in order (given, they replace them all); an essay or structural page's single row | |
multipleAnswers | boolean | Multichoice: more than one answer can be right | |
caseSensitive | boolean | Short answer: answers compared case-sensitively | |
fields | object | Any other field of the page's form, by name (layout, display…) |
move_lesson_page
Move a lesson's page
Move a lesson's page after another (0: first), as the lesson editor's move link does. Jumps by page id still lead to the same pages; next-page and previous-page follow the new order. Returns the page ids in order. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
lessonId | ✅ | integer | The lesson's id (course module id), as get_course_structure gives it |
pageId | ✅ | integer | The page's id, as get_lesson_pages gives it |
after | ✅ | integer | The page it goes after (0: first) |
delete_lesson_page
Delete a lesson's page
Delete a lesson's page. Answers of other pages that jumped to it are left as Moodle leaves them: check them with get_lesson_pages. Returns the page ids left, in order. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
lessonId | ✅ | integer | The lesson's id (course module id), as get_course_structure gives it |
pageId | ✅ | integer | The page's id, as get_lesson_pages gives it |
get_database_fields
Read a database's fields
Read a database activity's fields in order: each one's id, name (templates name it [[name]]), type, description, whether an entry needs it, and its type's settings (choices, sizes…). Takes an editing teacher's role.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
databaseId | ✅ | integer | The database's id (course module id), as get_course_structure gives it |
add_database_field
Add a field to a database
Add a field to a database activity through Moodle's form for its type: text, textarea, number, date, menu, radiobutton, checkbox, multimenu, url, file, picture or latlong, with a name unique in the database, a description, whether it's required (not for a date), and the type's settings. Templates at Moodle's default show it; a saved template may need it added (set_database_template). Returns its id and the fields. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
databaseId | ✅ | integer | The database's id (course module id), as get_course_structure gives it |
type | ✅ | text, textarea, number, date, menu, radiobutton, checkbox, multimenu, url, file, picture, latlong | |
name | ✅ | string | |
description | string | ||
required | boolean | ||
options | object | The type's settings; each type takes only its own |
edit_database_field
Change a database's field
Change a database field's name, description, whether it's required, or its type's settings (one by one): what is left out stays. Renaming it renames its tag in the templates, as Moodle does. Its type can't change: delete it and add another. Returns the fields. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
databaseId | ✅ | integer | The database's id (course module id), as get_course_structure gives it |
fieldId | ✅ | integer | The field's id, as get_database_fields gives it |
name | string | ||
description | string | ||
required | boolean | ||
options | object | The type's settings; each type takes only its own |
delete_database_field
Delete a database's field
Delete a database field: what every entry has in it goes too, and its tags leave the templates. Returns the fields. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
databaseId | ✅ | integer | The database's id (course module id), as get_course_structure gives it |
fieldId | ✅ | integer | The field's id, as get_database_fields gives it |
get_database_templates
Read a database's templates
Read a database activity's templates (list, listHeader, listFooter, single, add, search, rss, rssTitle, css, js): what was saved, or Moodle's default for its fields. Fields appear as [[name]], Moodle's other tags as ##tag##. Refused before the database has a field (Moodle has no templates yet). Takes an editing teacher's role.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
databaseId | ✅ | integer | The database's id (course module id), as get_course_structure gives it |
set_database_template
Set a database's template
Save one of a database's templates as given, without Moodle's HTML editor in between: list (repeated per entry, between listHeader and listFooter), single, add (the entry form: each field's tag once), search, rss, rssTitle, css or js. Fields go in as [[name]], Moodle's other tags as ##tag## (##edit##, ##delete##, ##more##, ##user##…). reset: true puts back Moodle's default. Returns every template. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
databaseId | ✅ | integer | The database's id (course module id), as get_course_structure gives it |
template | ✅ | list, listHeader, listFooter, single, add, search, rss, rssTitle, css, js | |
html | string | The template (HTML, or CSS or JavaScript) | |
reset | boolean | Moodle's default instead (the list's header and footer stay) |
list_database_presets
List the presets for a database
List the presets a database activity can be given: Moodle's own (image gallery, journal, proposals, resources) and those saved on the site that the person can see, each with the id apply_database_preset takes.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
databaseId | ✅ | integer | The database's id (course module id), as get_course_structure gives it |
apply_database_preset
Give a database a preset
Give a database activity a preset, as Moodle's "Use this preset" does: its fields are added, a field with the same name and type is kept with what entries have in it, every other field is deleted with its content, and its templates replace the database's. Returns the fields. Can delete entries' content: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
databaseId | ✅ | integer | The database's id (course module id), as get_course_structure gives it |
presetId | ✅ | string | As list_database_presets gives it |
list_database_entries
Read a database's entries
Read a database activity's entries in its list's order: author (an alias when the server pseudonymizes), when added and changed, whether approved, and each field's value for the entries the person can edit (all of them for a teacher; their own for a student). search is Moodle's simple search. A page at a time: limit entries (25 by default) after skipping offset; more says whether there are others.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
databaseId | ✅ | integer | The database's id (course module id), as get_course_structure gives it |
search | string | ||
limit | integer | How many entries (25 by default, up to 100) | |
offset | integer | How many entries to skip first (0 by default) |
add_database_entry
Add an entry to a database
Add an entry to a database activity as the person, through its "Add entry" form: a value per field, by id or name (get_database_fields names them), local files for file and picture fields; fields left out stay as the form has them (a date starts at today). Returns the entry's id. Others in the course may read it: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
databaseId | ✅ | integer | The database's id (course module id), as get_course_structure gives it |
values | ✅ | object | By field id or name: text or a number; "YYYY-MM-DD" for a date; the choices for checkboxes or a multi-select list; [latitude, longitude]; a local file's absolute path for a file or picture field. No aliases in them. |
edit_database_entry
Change a database entry
Change a database entry through its edit form: the fields given (files too), the rest as they are; removeFiles takes a file or picture field's file away. A student changes their own while Moodle lets them; a teacher, anyone's. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
databaseId | ✅ | integer | The database's id (course module id), as get_course_structure gives it |
entryId | ✅ | integer | The entry's id, as list_database_entries gives it |
values | object | By field id or name: text or a number; "YYYY-MM-DD" for a date; the choices for checkboxes or a multi-select list; [latitude, longitude]; a local file's absolute path for a file or picture field. No aliases in them. | |
removeFiles | string list | File or picture fields (by id or name) whose file to remove |
delete_database_entry
Delete a database entry
Delete a database entry with its values and files. A student deletes their own while Moodle lets them change it; a teacher, anyone's. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
databaseId | ✅ | integer | The database's id (course module id), as get_course_structure gives it |
entryId | ✅ | integer | The entry's id, as list_database_entries gives it |
set_database_entry_approved
Approve a database entry
Approve a database entry waiting for approval, or take its approval back: one waiting shows only to its author and to who approves. Its author sees it: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
databaseId | ✅ | integer | The database's id (course module id), as get_course_structure gives it |
entryId | ✅ | integer | The entry's id, as list_database_entries gives it |
approved | ✅ | boolean |
export_database_entries
Export a database's entries to CSV
Save a database activity's entries to a local CSV file, as its "Export entries" does: a column per field (images and files aren't in it), with the authors' details, times and approval if asked. Every entry of the person's group. The file holds what participants wrote as is: only with names in clear (the server's student data level).
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
databaseId | ✅ | integer | The database's id (course module id), as get_course_structure gives it |
file | ✅ | string | An absolute local path for the CSV (replaced if it's there) |
userDetails | boolean | The authors' full name, username and email | |
times | boolean | ||
approval | boolean |
import_database_entries
Import entries into a database from CSV
Add entries to a database activity from a local CSV file, as its "Import entries" does: a header row with the fields' names (as export_database_entries writes it; a Username column makes that user the author), UTF-8. Returns how many Moodle added. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
databaseId | ✅ | integer | The database's id (course module id), as get_course_structure gives it |
file | ✅ | string | An absolute local path to the CSV |
delimiter | comma, semicolon, tab, colon |
list_glossary_entries
Read a glossary's entries
Read a glossary's entries in its order: concept, definition (HTML), aliases, categories, author (an alias when the server pseudonymizes), whether approved, attachments. What the person sees: approved entries and their own waiting; pending gives those waiting for approval, for a teacher. By letter, or a search of concepts, aliases and definitions. A page at a time: limit entries (30 by default) after skipping offset; more says whether there are others.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
glossaryId | ✅ | integer | The glossary's id (course module id), as get_course_structure gives it |
letter | string | Only concepts starting with this letter | |
search | string | Words in concepts, aliases or definitions | |
pending | boolean | The entries waiting for approval instead (a teacher's) | |
limit | integer | How many entries (30 by default, up to 200) | |
offset | integer | How many entries to skip first (0 by default) |
add_glossary_entry
Add an entry to a glossary
Add an entry to a glossary as the person: its concept, definition (HTML, with local images embedded), aliases, categories and attached local files. A student's entry waits for a teacher's approval where the glossary asks for it. Returns the entry. Others in the course read it: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
glossaryId | ✅ | integer | The glossary's id (course module id), as get_course_structure gives it |
concept | ✅ | string | |
definition | ✅ | string | HTML; no aliases in it |
aliases | string list | Other words it's found and linked by | |
categoryIds | integer list | As list_glossary_categories gives them | |
attachments | string list | Absolute local paths of files to attach | |
embed | string list | Absolute local files to embed in the definition, which names each by its file name: <img src="shot.png"> |
edit_glossary_entry
Change a glossary entry
Change a glossary entry: only what is given (attachments replaces its files, [] removes them). A student changes their own while the site's editing time lasts; a teacher, anyone's. Returns the entry. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
glossaryId | ✅ | integer | The glossary's id (course module id), as get_course_structure gives it |
entryId | ✅ | integer | The entry's id, as list_glossary_entries gives it |
concept | string | ||
definition | string | HTML; no aliases in it | |
aliases | string list | Other words it's found and linked by | |
categoryIds | integer list | As list_glossary_categories gives them | |
attachments | string list | Absolute local paths of files to attach | |
embed | string list | Absolute local files to embed in the definition, which names each by its file name: <img src="shot.png"> |
delete_glossary_entry
Delete a glossary entry
Delete a glossary entry with its files. A student deletes their own while the site's editing time lasts; a teacher, anyone's. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
glossaryId | ✅ | integer | The glossary's id (course module id), as get_course_structure gives it |
entryId | ✅ | integer | The entry's id, as list_glossary_entries gives it |
set_glossary_entry_approved
Approve a glossary entry
Approve an entry waiting for approval (list_glossary_entries with pending lists them), or take an approval back: the entry then waits again, hidden from all but its author and who approves. Its author sees it: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
glossaryId | ✅ | integer | The glossary's id (course module id), as get_course_structure gives it |
entryId | ✅ | integer | The entry's id, as list_glossary_entries gives it |
approved | ✅ | boolean |
list_glossary_categories
List a glossary's categories
List a glossary's categories, by id and name, which add_glossary_entry and edit_glossary_entry take.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
glossaryId | ✅ | integer | The glossary's id (course module id), as get_course_structure gives it |
add_glossary_category
Add a category to a glossary
Add a category to a glossary; with autoLink, Moodle links its name wherever it appears in the course. Returns its id and the categories. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
glossaryId | ✅ | integer | The glossary's id (course module id), as get_course_structure gives it |
name | ✅ | string | |
autoLink | boolean |
export_glossary
Export a glossary's entries to a file
Save a glossary's approved entries into a local folder as Moodle's XML (with aliases, categories and files), as its "Export entries" does; import_glossary brings them into another glossary. The file holds what participants wrote as is: only with names in clear (the server's student data level).
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
glossaryId | ✅ | integer | The glossary's id (course module id), as get_course_structure gives it |
destDir | ✅ | string | An absolute local folder |
import_glossary
Import entries into a glossary
Import the entries of a glossary's XML file (as export_glossary saves it) into this glossary, as the person's own entries, approved; with categories, their categories too. Moodle rejects duplicates where the glossary takes none, and entries without concept or definition. Returns how many came in. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
glossaryId | ✅ | integer | The glossary's id (course module id), as get_course_structure gives it |
file | ✅ | string | An absolute local path to the XML file |
categories | boolean | Bring the entries' categories, adding missing ones |
list_wiki_pages
List a wiki's pages
List the pages of a wiki's subwiki by title: each one's id, the pages it links to (those not created yet without an id) and its latest version (number, date, author as an alias when the server pseudonymizes). The person's subwiki unless groupId or participant choose another. Empty while it has no pages. A page at a time: limit pages (50 by default) after skipping offset; more says whether there are others.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
wikiId | ✅ | integer | The wiki's id (course module id), as get_course_structure gives it |
groupId | integer | A group's subwiki, in a wiki with groups; the person's own when missing | |
participant | string | A participant's subwiki in an individual wiki, by alias when the server pseudonymizes | |
participantId | integer | Or by user id, when the server shows names | |
limit | integer | How many pages (50 by default, up to 200) | |
offset | integer | How many pages to skip first (0 by default) |
get_wiki_page
Read a wiki page
Read a wiki page: its content (HTML as Moodle renders it, its text, images and media), its sections, the pages it links to and its latest version; with history, every version, newest first. Authors as aliases, and pages others wrote redacted, when the server pseudonymizes.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
wikiId | ✅ | integer | The wiki's id (course module id), as get_course_structure gives it |
pageId | ✅ | integer | The page's id, as list_wiki_pages gives it |
history | boolean | Every version too |
create_wiki_page
Create a wiki page
Create a page in a wiki's subwiki as the person, with its content (HTML in an HTML wiki, Moodle's default, or the wiki's markup; [[Title]] links to another page): the person's subwiki unless groupId or participant choose another. A subwiki's first page must have the wiki's first page title. Returns the page. Others in the course read it: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
wikiId | ✅ | integer | The wiki's id (course module id), as get_course_structure gives it |
title | ✅ | string | |
content | ✅ | string | No aliases in it |
embed | string list | Absolute local files to embed in the content (HTML pages), which names each by its file name: <img src="shot.png"> | |
groupId | integer | A group's subwiki, in a wiki with groups; the person's own when missing | |
participant | string | A participant's subwiki in an individual wiki, by alias when the server pseudonymizes | |
participantId | integer | Or by user id, when the server shows names |
edit_wiki_page
Edit a wiki page
Change a wiki page's content, the whole page or one section (a heading, as get_wiki_page's sections lists them), as its editor does: a new version, by the person. Refused while someone else has the page open in its editor: try again later. Returns the page. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
wikiId | ✅ | integer | The wiki's id (course module id), as get_course_structure gives it |
pageId | ✅ | integer | The page's id, as list_wiki_pages gives it |
content | ✅ | string | Replaces the page's, or the section's; no aliases in it |
section | string | ||
embed | string list | Absolute local files to embed in the content (HTML pages), which names each by its file name: <img src="shot.png"> |
get_feedback_items
Read a feedback's questions
Read a feedback activity's items as its teacher builds them, in order: type (multichoice, multichoicerated, textfield, textarea, numeric, info, label, captcha, pagebreak), position, question, whether required, a choice's options (with weights where rated) and display, a numeric range, a label's contents and the item it depends on.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
feedbackId | ✅ | integer | The feedback's id (course module id), as get_course_structure gives it |
add_feedback_item
Add a question to a feedback
Add an item to a feedback activity, after item after (0: first; last without it): a question of any type with its options and settings, a label with its contents, or a page break or a CAPTCHA. Returns its id and the items in order. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
feedbackId | ✅ | integer | The feedback's id (course module id), as get_course_structure gives it |
type | ✅ | multichoice, multichoicerated, textfield, textarea, numeric, info, label, captcha, pagebreak | |
question | string | Every type but a label and a page break needs one | |
label | string | ||
required | boolean | ||
options | object list | Choice items' options, in order; given, they replace them all | |
display | radio, checkbox, dropdown | checkbox (several answers) for multichoice only | |
horizontal | boolean | ||
hideNotSelected | boolean | ||
ignoreEmpty | boolean | ||
range | object | A numeric item's; a bound left out is none | |
info | response-time, course, category | ||
contents | string | A label's (HTML) | |
dependsOn | object | Show it only when another item was answered with this value: an item with a label, on an earlier page (a page break between them) | |
fields | object | Any other field of the item's form, by name (itemsize, itemmaxlength…) | |
after | integer | The item it goes after (0: first) |
edit_feedback_item
Change a feedback's question
Change a feedback item with what is given: question, label, required, a choice's options (given, they replace them all) and settings, a numeric range, a label's contents, its dependency (removeDependency takes it away) and other fields. It keeps its type and place. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
feedbackId | ✅ | integer | The feedback's id (course module id), as get_course_structure gives it |
itemId | ✅ | integer | The item's id, as get_feedback_items gives it |
question | string | Every type but a label and a page break needs one | |
label | string | ||
required | boolean | ||
options | object list | Choice items' options, in order; given, they replace them all | |
display | radio, checkbox, dropdown | checkbox (several answers) for multichoice only | |
horizontal | boolean | ||
hideNotSelected | boolean | ||
ignoreEmpty | boolean | ||
range | object | A numeric item's; a bound left out is none | |
info | response-time, course, category | ||
contents | string | A label's (HTML) | |
dependsOn | object | Show it only when another item was answered with this value: an item with a label, on an earlier page (a page break between them) | |
fields | object | Any other field of the item's form, by name (itemsize, itemmaxlength…) | |
removeDependency | boolean |
move_feedback_item
Move a feedback's question
Move a feedback item to a position (from 1). Returns the items in order. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
feedbackId | ✅ | integer | The feedback's id (course module id), as get_course_structure gives it |
itemId | ✅ | integer | The item's id, as get_feedback_items gives it |
position | ✅ | integer |
delete_feedback_item
Delete a feedback's question
Delete a feedback item; the answers people gave to it go with it. Returns the items left. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
feedbackId | ✅ | integer | The feedback's id (course module id), as get_course_structure gives it |
itemId | ✅ | integer | The item's id, as get_feedback_items gives it |
list_feedback_templates
List feedback templates
List the templates a feedback activity can use: the course's own and the site's public ones.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
feedbackId | ✅ | integer | The feedback's id (course module id), as get_course_structure gives it |
use_feedback_template
Use a template in a feedback
Add a template's items to a feedback activity, after the items it has, or in their place with replace (their answers go with them). Returns the items. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
feedbackId | ✅ | integer | The feedback's id (course module id), as get_course_structure gives it |
templateId | ✅ | integer | As list_feedback_templates gives it |
replace | boolean |
save_feedback_template
Save a feedback as a template
Save a feedback activity's items as a new template: the course's own, or public (every course's, a manager's) with public. Returns its id. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
feedbackId | ✅ | integer | The feedback's id (course module id), as get_course_structure gives it |
name | ✅ | string | |
public | boolean |
delete_feedback_template
Delete a feedback template
Delete a feedback template (a public one takes a manager's rights). Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
feedbackId | ✅ | integer | The feedback's id (course module id), as get_course_structure gives it |
templateId | ✅ | integer | As list_feedback_templates gives it |
Course life cycle
| Tool | Description | Read only | Teacher | Student |
|---|---|---|---|---|
copy_course | Copy a course | ✓ | ||
backup_course | Back up a course | ✓ | ||
restore_course | Restore a course backup | ✓ | ||
read_backup | Read what a backup file holds | ✓ | ✓ | |
anonymize_backup | Anonymize a backup file | ✓ | ✓ | |
import_activities | Import activities from another course | ✓ | ||
reset_course | Reset a course for a new year | ✓ | ||
copy_between_sites | Copy course content to another site | ✓ |
copy_course
Copy a course
Copy a course into a new one, as Moodle's "Copy course" does: its content (and, with withUsers, its people's enrolments and data) under a new full and short name, in a category (the course's unless given), with new dates. Needs the rights to back up, restore and create courses. It can take minutes: Moodle does it in steps, and waits up to ten. Creates a course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
fullName | ✅ | string | |
shortName | ✅ | string | |
categoryId | integer | ||
start | string | The new course's start, ISO 8601 | |
end | string | The new course's end, ISO 8601 | |
withUsers | boolean | Also its participants and their data (default false) | |
visible | boolean |
backup_course
Back up a course
Back a course up to a .mbz file in a local folder, through Moodle's backup wizard: its content, and with withUsers its people's data too (anonymize makes their names anonymous). Or only some of it: sections (each with everything in it) and activities, never with people's data, and the file naming no one and no site unless anonymous is false. Moodle keeps a copy in the course's backup area. Restore it with restore_course, on this site or another. It can take minutes: Moodle does it in steps, and waits up to ten.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
destDir | ✅ | string | An absolute local folder for the file |
withUsers | boolean | Also its participants' data (default false) | |
anonymize | boolean | With users: Moodle makes their names and contact data anonymous | |
sections | integer list | Only these sections, by id (get_course_structure), each with everything in it | |
activities | integer list | Only these activities and resources, by course module id | |
anonymous | boolean | The file names no person and no site or course of origin: true by default for sections or activities, false for a whole course |
restore_course
Restore a course backup
Restore a .mbz backup through Moodle's restore wizard: into a new course in a category (no intoCourseId), or into an existing course, adding to its content (mode merge, the default) or replacing it (replace deletes the course's content first). Merged into a course, sectionId puts every restored activity at the end of that section, and afterSectionId the backup's sections as new ones after that one; the result names the new sections and activities, and warnings what was left broken (restrictions or links to what wasn't restored) for the person to fix. A new course takes the backup's names unless fullName and shortName are given. A backup from a newer Moodle, or with activity types this site doesn't offer, is refused. It can take minutes: Moodle does it in steps, and waits up to ten. Changes Moodle, and replace can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
file | ✅ | string | The backup's absolute local path (.mbz) |
intoCourseId | integer | An existing course to restore into; a new course when missing | |
categoryId | integer | For a new course: its category | |
mode | merge, replace | Into an existing course: add to it (default) or replace its content | |
fullName | string | ||
shortName | string | ||
withUsers | boolean | Restore the participants' data the backup has (default false) | |
sectionId | integer | Merged into a course: every restored activity at the end of this section | |
afterSectionId | integer | Merged into a course: the backup's sections as new sections after this one |
read_backup
Read what a backup file holds
Read a Moodle backup file (.mbz) on this computer without restoring it, without Moodle: the Moodle that made it, the original site and course, its sections and activities (the original site's ids), the plugins a site needs to restore it, whether it holds people's data or the gradebook, what each activity refers to that the backup doesn't hold (restrictions on activities left out, links to them, its grade category), which a restore elsewhere leaves broken, and what in it still names a person, the site or the course. Use it before restore_course or before sharing a backup.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
file | ✅ | string | An absolute local path to the .mbz file |
anonymize_backup
Anonymize a backup file
Write a copy of a Moodle backup file (.mbz) that names no one and no site, on this computer, without Moodle: every user id 0, authors' names empty, the original site's address, the course's id and names and the backup's log replaced by neutral values; the content (texts, settings, files) as it was. Moodle restores it as a backup from another site. Refused for a backup with people's data (Moodle's own anonymize makes those). Returns what was cleared. For sharing a unit with other teachers.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
file | ✅ | string | An absolute local path to the .mbz file |
destFile | ✅ | string | Where to write the copy (an absolute local path; it may be file itself) |
import_activities
Import activities from another course
Import activities from another course into a course, as Moodle's "Import" does: all of them, or only activityIds, with their sections, never people's data. Returns the new activities' ids. It can take minutes: Moodle does it in steps, and waits up to ten. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
fromCourseId | ✅ | integer | |
toCourseId | ✅ | integer | |
activityIds | integer list | Only these activities of the other course (course module ids) |
reset_course
Reset a course for a new year
Reset a course as Moodle's reset form does: delete only what's named in delete (submissions, attempts, posts, grades… in every activity that has them), unenrol the people with unenrolRoles, move the start date (and the activities' dates with it), and set any other field of the form by name. Nothing is deleted unless named. Can't be undone: confirm every item with the person first. Returns Moodle's report. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
delete | object | ||
unenrolRoles | integer list | Role ids whose people are unenrolled | |
start | string | The new start date, ISO 8601 | |
fields | object | Any other field of the reset form, by name |
copy_between_sites
Copy course content to another site
Copy a course's content from one of this server's sites to another (list_sites): some activities (activityIds), some sections with everything in them (sectionIds), or, with neither, the whole course. Through Moodle's backup on the first site and its restore on the second, never with people's data and naming no one; the file stays on this computer, never passes through you, and is deleted after. It goes into an existing course (toCourseId): at the end of one of its sections (toSectionId), or, for sections, as new ones after toAfterSectionId; a whole course can go into a new course in a category instead (toCategoryId). Returns what was created, and warnings for what was left broken (restrictions or links to what wasn't copied) for the person to fix. Each site needs a session (use_site, then login). The active site stays the same. Within one site, use import_activities or copy_course. It can take minutes. Changes the target site: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
fromSite | ✅ | string | A site's name, as list_sites gives it |
courseId | ✅ | integer | The course to copy from, on fromSite |
activityIds | integer list | Only these activities and resources, by course module id | |
sectionIds | integer list | Only these sections, by id, each with everything in it | |
toSite | ✅ | string | A site's name, as list_sites gives it |
toCourseId | integer | An existing course on toSite to copy into | |
toSectionId | integer | Into toCourseId: every copied activity at the end of this section | |
toAfterSectionId | integer | Into toCourseId: copied sections as new sections after this one | |
toCategoryId | integer | A whole course only: a new course in this category on toSite, instead of toCourseId |
Assignments and grading
| Tool | Description | Read only | Teacher | Student |
|---|---|---|---|---|
list_assignments | List a course's assignments | ✓ | ✓ | ✓ |
get_submissions | Get an assignment's submissions | ✓ | ✓ | |
get_rubric | Get an assignment's grading criteria | ✓ | ✓ | |
set_rubric | Define an assignment's rubric or marking guide | ✓ | ||
grade_submission | Grade a submission | ✓ | ||
grant_extension | Grant an assignment extension | ✓ | ||
set_workflow_state | Set the marking workflow state | ✓ | ||
allocate_marker | Allocate a marker to submissions | ✓ |
list_assignments
List a course's assignments
List the assignments of a Moodle course: their ids (course module ids, for the other assignment tools), names, URLs, visibility and section. Takes the course id from list_courses.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | The course's id, as list_courses gives it |
get_submissions
Get an assignment's submissions
Get the participants' submissions to a Moodle assignment, a page at a time (limit participants, 25 by default, after skipping offset; more says whether there are others): who (an alias when the server pseudonymizes, else id and name), status (submitted; draft; new: a submission started but nothing in it yet; reopened; none: no submission at all), whether it needs grading, extensions, the participant's dates and, by default, the content (online text and file links; names and contact data in it redacted when pseudonymizing). Changes nothing, but Moodle logs it as the teacher viewing the grading pages, as it does for its own grader. Takes the assignment id from list_assignments.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
assignmentId | ✅ | integer | The assignment's id (its course module id), as list_assignments gives it |
includeContent | boolean | Include each submission's content: online text and file links (default true) | |
limit | integer | How many participants (25 by default, up to 200) | |
offset | integer | How many participants to skip first, in the grading table's order (0 by default) |
get_rubric
Get an assignment's grading criteria
Read how an assignment is graded: simple (a grade or a scale), a rubric (criteria with their levels and scores) or a marking guide (criteria with their maximum score). The criterion and level ids are what grade_submission's fields take. Takes the assignment id from list_assignments; needs at least one participant.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
assignmentId | ✅ | integer | The assignment's id (course module id), as list_assignments gives it |
set_rubric
Define an assignment's rubric or marking guide
Define how an assignment is graded with a rubric (criteria, each with two levels or more: a definition and its score) or a marking guide (criteria, each with a short name, a description for students, one for markers and a maximum score, and the guide's frequently used comments), through Moodle's advanced grading editor, ready to use. Creates one where there is none and replaces the one there is, so its criterion and level ids change. Refused once anything has been graded with it: Moodle would regrade. Returns the definition as get_rubric gives it. Changes how students are graded: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
assignmentId | ✅ | integer | The assignment's id (course module id), as list_assignments gives it |
method | ✅ | rubric, guide | |
name | ✅ | string | Its name, as the advanced grading page lists it |
description | string | Its description (HTML) | |
criteria | ✅ | object list | In order |
comments | string list | A marking guide's frequently used comments, in order |
grade_submission
Grade a submission
Grade a participant in an assignment, as Moodle's grader does: a grade (simple grading), a rubric's levels or a marking guide's scores per criterion (ids from get_rubric) with remarks, feedback comments (HTML, when the assignment has them on), whether to notify the student, and any other grading field by name in fields. Takes the participant as get_submissions gives them: user (an alias) when the server pseudonymizes, else userId. Works with or without a submission. Returns the grade saved. Changes grades students may see: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
assignmentId | ✅ | integer | The assignment's id (course module id), as list_assignments gives it |
user | string | The participant's alias, as the reading tools give it when the server pseudonymizes | |
userId | integer | The participant's user id, when the server shows names | |
grade | string | The grade as text: a number within the range ("7.5"), or a scale item | |
feedback | string | Feedback comments (HTML); no aliases in it, since the student reads it | |
notify | boolean | Notify the student; Moodle's default when missing | |
rubric | object | A rubric's level per criterion: criterion id → level id, as get_rubric gives them | |
guide | object | A marking guide's score per criterion: criterion id → score | |
remarks | object | Remarks per criterion of a rubric or guide: criterion id → text; no aliases | |
feedbackFiles | string list | Absolute local paths of feedback files to return to the student | |
workflowState | notmarked, inmarking, readyforreview, inreview, readyforrelease, released | With the marking workflow on: the state to leave the submission in ("released" shows the student the grade) | |
applyToGroup | boolean | In a group assignment: give the same grade and feedback to the whole group | |
fields | object | Other grading form fields by name, e.g. a rubric's levels |
grant_extension
Grant an assignment extension
Grant participants an extension of an assignment's due date until a date, as the assignment's extension form does (several at once). Takes them as get_submissions gives them: users (aliases) when the server pseudonymizes, else userIds. Moodle refuses a date before the due date. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
assignmentId | ✅ | integer | The assignment's id (course module id), as list_assignments gives it |
users | string list | The participants' aliases, when the server pseudonymizes | |
userIds | integer list | The participants' user ids, when the server shows names | |
until | ✅ | string | ISO 8601, e.g. 2026-11-03T23:59:00+01:00 |
set_workflow_state
Set the marking workflow state
Set the marking workflow state of participants' submissions, as the grading table's bulk action does: "released" shows them their grades (notify tells them). Takes them as get_submissions gives them. Students may see it: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
assignmentId | ✅ | integer | The assignment's id (course module id), as list_assignments gives it |
users | string list | The participants' aliases, as the reading tools give them when the server pseudonymizes | |
userIds | integer list | The participants' user ids, when the server shows names | |
state | ✅ | inmarking, readyforreview, inreview, readyforrelease, released | |
notify | boolean |
allocate_marker
Allocate a marker to submissions
Allocate a marker (someone who can grade; several where the assignment uses several per submission) to participants' submissions, as the grading table's bulk action does; Moodle leaves submissions past marking alone. Participants and markers as get_submissions gives them: aliases when the server pseudonymizes. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
assignmentId | ✅ | integer | The assignment's id (course module id), as list_assignments gives it |
users | string list | The participants' aliases, as the reading tools give them when the server pseudonymizes | |
userIds | integer list | The participants' user ids, when the server shows names | |
markers | string list | The markers' aliases, when the server pseudonymizes | |
markerIds | integer list | The markers' user ids, when the server shows names |
Quizzes and questions
| Tool | Description | Read only | Teacher | Student |
|---|---|---|---|---|
list_question_banks | List a course's question banks | ✓ | ✓ | |
list_question_types | List the question types the site offers | ✓ | ✓ | |
list_questions | List a bank's questions | ✓ | ✓ | |
validate_gift | Check GIFT questions before importing them | ✓ | ✓ | |
import_questions | Import questions into a bank | ✓ | ||
create_question | Create a question in a bank | ✓ | ||
update_question | Change a question in a bank | ✓ | ||
delete_questions | Delete questions from a bank | ✓ | ||
set_question_status | Set a question ready or draft | ✓ | ||
list_question_categories | List a question bank's categories | ✓ | ✓ | |
add_question_category | Add a category to a question bank | ✓ | ||
edit_question_category | Rename or move a question category | ✓ | ||
delete_question_category | Delete a question category | ✓ | ||
move_questions | Move questions to another category | ✓ | ||
export_questions | Export a bank's questions to a file | ✓ | ✓ | |
get_quiz_structure | Get a quiz's questions | ✓ | ✓ | |
add_questions_to_quiz | Add questions to a quiz | ✓ | ||
edit_quiz_slot | Change a quiz question's mark or place | ✓ | ||
remove_quiz_slot | Remove a question from a quiz | ✓ | ||
set_quiz_pages | Set a quiz's pages | ✓ | ||
add_quiz_section | Add a section to a quiz | ✓ | ||
get_quiz_results | Get a quiz's results | ✓ | ✓ | |
get_quiz_statistics | Read a quiz's statistics | ✓ | ✓ | |
set_quiz_override | Set a quiz override for a participant | ✓ | ||
list_questions_to_grade | List a quiz's questions to grade by hand | ✓ | ✓ | |
grade_quiz_question | Grade a quiz question by hand | ✓ |
list_question_banks
List a course's question banks
List the question banks of a course: its shared banks (usable by any quiz in the course) and the activities' own banks (a quiz's, usable only there). Returns their ids, which list_questions, import_questions and create_question take. On Moodle 4.x a course has one bank, its own, whose id is the course's.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer |
list_question_types
List the question types the site offers
List the question types the site has enabled, as the bank's "Create a new question" chooser offers them to you: each one's internal name (the type create_question takes), the name and description Moodle shows, whether it's a plugin, and its group ("question" for the types that ask something, "other" for a description). Check it before choosing a question type: it may hold more types than create_question can make (21 of them) or fewer, and it works in a course with no questions yet. Empty when you may see the bank but not add questions to it. Takes the bank id from list_question_banks.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bankId | ✅ | integer | The bank's id (a course module id), as list_question_banks gives it |
list_questions
List a bank's questions
List a question bank's categories and the questions in them, category by category: id, name, type, status and category. A page at a time: limit questions (100 by default) after skipping offset; more says whether there are others. Takes the bank id from list_question_banks.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bankId | ✅ | integer | The bank's id (a course module id), as list_question_banks gives it |
limit | integer | How many questions (100 by default, up to 1000) | |
offset | integer | How many questions to skip first, category by category (0 by default) |
validate_gift
Check GIFT questions before importing them
Check questions in GIFT before import_questions, without Moodle: each question split at blank lines as Moodle's importer does, with its type in Moodle's names, title, text and answers, and each problem with its line (a question Moodle can't read, a weight it doesn't take, a multiple choice with no right answer, a matching question with fewer than two pairs); ordering questions in their own GIFT ({>…}) too, as Moodle exports them. Fix what it reports and check again; valid means Moodle should import every question.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
text | string | The questions in GIFT | |
file | string | Or an absolute path to a local GIFT file |
import_questions
Import questions into a bank
Import questions into a question bank from GIFT or Moodle XML, given as text or as a local file, through the bank's import form: the way to add several at once. Moodle checks the whole file first: when it can't parse it, nothing is imported and its messages come back. Returns the questions created. Changes the bank: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bankId | ✅ | integer | The bank's id (a course module id), as list_question_banks gives it |
format | ✅ | gift, xml | |
text | string | The questions in that format | |
file | string | Or an absolute path to a local file in that format | |
categoryId | integer | The bank category, as list_questions gives it; the bank's default when missing |
create_question
Create a question in a bank
Create one question in a question bank through its type's form, of any type: multichoice, truefalse, shortanswer, numerical, essay, calculated (simple and multichoice too), match, randomsamatch, drag and drop into text (ddwtos), onto an image (ddimageortext), markers (ddmarker), select missing words (gapselect), Cloze (multianswer, its answers in the text), ordering, description, and the plugins coderunner, formulas, gapfill and ddmatch where the site has them. Each type takes its own inputs, checked before Moodle. The text holds the type's places: [[1]] for ddwtos and gapselect, {1:SHORTANSWER:=Paris} for Cloze, [gaps] for gapfill, {wildcards} for calculated. For several, import_questions is faster. Returns the new question's id. Changes the bank: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bankId | ✅ | integer | The bank's id (a course module id), as list_question_banks gives it |
type | ✅ | multichoice, truefalse, shortanswer, numerical, essay, calculated, calculatedsimple, calculatedmulti, match, randomsamatch, ddwtos, ddimageortext, ddmarker, gapselect, multianswer, ordering, description, coderunner, formulas, gapfill, ddmatch | |
name | ✅ | string | |
text | ✅ | string | The question text (HTML) |
answers | object list | Multichoice, shortanswer and numerical answers | |
correct | boolean | Truefalse: the right answer | |
pairs | object list | match, ddmatch: each question and its answer; an answer without a question is a distractor | |
choose | integer | randomsamatch: how many short-answer questions of the category it draws | |
choices | object list | ddwtos, gapselect: the choices [[1]], [[2]]… in the text name, by position | |
image | string | ddimageortext, ddmarker: the background image, an absolute local path | |
drags | object list | ddimageortext: the draggable items | |
markers | object list | ddmarker: the markers | |
drops | object list | ddimageortext, ddmarker: where the items or markers go | |
items | string list | ordering: the items, in the right order | |
wildcards | object list | calculated, calculatedsimple, calculatedmulti: each {wildcard}'s values; Moodle's 1 to 10 without them | |
sets | integer | Calculated types: how many sets of values (10 by default) | |
coderunner | object | coderunner (a plugin) | |
formulas | object | formulas (a plugin) | |
categoryId | integer | The bank category, as list_questions gives it; the bank's default when missing | |
defaultMark | number | ||
fields | object | Any other field of the type's form, by name |
update_question
Change a question in a bank
Change a question of a bank through its type's form, with create_question's inputs: only what's given changes (a list given, such as answers, pairs, choices, items, drags, markers, drops or a wildcard's values, replaces the question's). Saving makes a new version with its own id, the one returned, which quizzes using the latest version get from then on. Changes the bank: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bankId | ✅ | integer | The bank's id (a course module id), as list_question_banks gives it |
questionId | ✅ | integer | As list_questions gives it |
name | string | ||
text | string | The question text (HTML) | |
answers | object list | Multichoice, shortanswer and numerical answers | |
correct | boolean | Truefalse: the right answer | |
pairs | object list | match, ddmatch: each question and its answer; an answer without a question is a distractor | |
choose | integer | randomsamatch: how many short-answer questions of the category it draws | |
choices | object list | ddwtos, gapselect: the choices [[1]], [[2]]… in the text name, by position | |
image | string | ddimageortext, ddmarker: the background image, an absolute local path | |
drags | object list | ddimageortext: the draggable items | |
markers | object list | ddmarker: the markers | |
drops | object list | ddimageortext, ddmarker: where the items or markers go | |
items | string list | ordering: the items, in the right order | |
wildcards | object list | calculated, calculatedsimple, calculatedmulti: each {wildcard}'s values; Moodle's 1 to 10 without them | |
sets | integer | Calculated types: how many sets of values (10 by default) | |
coderunner | object | coderunner (a plugin) | |
formulas | object | formulas (a plugin) | |
categoryId | integer | The bank category, as list_questions gives it; the bank's default when missing | |
defaultMark | number | ||
fields | object | Any other field of the type's form, by name |
delete_questions
Delete questions from a bank
Delete questions from a bank, every version of each, as the bank's delete action does. Moodle doesn't delete a question a quiz uses: it hides it, and hidden lists those. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bankId | ✅ | integer | The bank's id (a course module id), as list_question_banks gives it |
questionIds | ✅ | integer list | As list_questions gives them |
set_question_status
Set a question ready or draft
Set a bank question ready (quizzes can use it) or draft, as the bank's status menu does.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
questionId | ✅ | integer | As list_questions gives it |
status | ✅ | ready, draft |
list_question_categories
List a question bank's categories
List a question bank's categories as its categories page shows them, parents before their subcategories: id, name, parent, description and how many questions are directly in each. The bank's hidden Top is the top-level ones' parentId. Takes managing the bank's categories (a teacher's).
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bankId | ✅ | integer | The bank's id, as list_question_banks gives it (on Moodle 4.x, the course's id) |
add_question_category
Add a category to a question bank
Add a category to a question bank, at the top level or inside parentId, with an optional description (HTML). Returns the category. Changes the bank: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bankId | ✅ | integer | The bank's id, as list_question_banks gives it (on Moodle 4.x, the course's id) |
name | ✅ | string | |
parentId | integer | ||
description | string |
edit_question_category
Rename or move a question category
Change a question bank's category: its name, description (HTML) or parent (moving it with its subcategories and questions; the bank's Top moves it to the top level). Only what is given changes. Changes the bank: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bankId | ✅ | integer | The bank's id, as list_question_banks gives it (on Moodle 4.x, the course's id) |
categoryId | ✅ | integer | The category's id, as list_question_categories gives it |
name | string | ||
description | string | ||
parentId | integer |
delete_question_category
Delete a question category
Delete a question bank's category: its subcategories move up to its parent; one with questions needs moveTo, the category its questions go to. Moodle keeps a bank's last top-level category. Confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bankId | ✅ | integer | The bank's id, as list_question_banks gives it (on Moodle 4.x, the course's id) |
categoryId | ✅ | integer | The category's id, as list_question_categories gives it |
moveTo | integer | Where its questions go, when it has any |
move_questions
Move questions to another category
Move questions of a bank into one of its categories, several at once; each keeps its id and versions. Changes the bank: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bankId | ✅ | integer | The bank's id, as list_question_banks gives it (on Moodle 4.x, the course's id) |
questionIds | ✅ | integer list | As list_questions gives them |
categoryId | ✅ | integer | The category's id, as list_question_categories gives it |
export_questions
Export a bank's questions to a file
Save a bank's questions, or a category's with its subcategories, to a local GIFT or Moodle XML file: each question's latest version, hidden ones left out, with their categories, so import_questions recreates them. validate_gift reads a GIFT export back.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
bankId | ✅ | integer | The bank's id, as list_question_banks gives it (on Moodle 4.x, the course's id) |
format | ✅ | gift, xml | |
categoryId | integer | Only this category; the whole bank when missing | |
file | ✅ | string | An absolute local path (replaced if it's there) |
get_quiz_structure
Get a quiz's questions
List a quiz's questions as its edit page does, in order: each slot's page, question id, type (or random), name and mark. Teachers only.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
quizId | ✅ | integer | The quiz's id (course module id), as get_course_structure gives it |
add_questions_to_quiz
Add questions to a quiz
Add questions to a quiz: bank questions by id (from list_questions) and/or random questions from a bank category, at the end or on a given page. A quiz that has been attempted can't change its questions: Moodle refuses. Returns the quiz's structure afterwards. Changes the quiz: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
quizId | ✅ | integer | The quiz's id (course module id), as get_course_structure gives it |
questionIds | integer list | Bank questions, as list_questions gives them | |
random | object | Random questions drawn from a category | |
page | integer | The page to add them to; the last when missing |
edit_quiz_slot
Change a quiz question's mark or place
Change one slot of a quiz: its maximum mark, and where it is (after another slot, 0 for first, and on a page), as the edit page does. After attempts, Moodle lets the mark change (it regrades them) but not the order. Returns the quiz's structure. Changes the quiz: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
quizId | ✅ | integer | The quiz's id (course module id), as get_course_structure gives it |
slot | ✅ | integer | The slot's place in the quiz, from 1, as get_quiz_structure gives it |
maxMark | number | ||
moveAfter | integer | Put it after this slot (0: first) | |
page | integer | The page to put it on |
remove_quiz_slot
Remove a question from a quiz
Remove a slot from a quiz, as the edit page's delete icon does; the question stays in its bank. A quiz with attempts can't change its questions. Returns the quiz's structure. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
quizId | ✅ | integer | The quiz's id (course module id), as get_course_structure gives it |
slot | ✅ | integer | The slot's place in the quiz, from 1, as get_quiz_structure gives it |
set_quiz_pages
Set a quiz's pages
Set how a quiz's questions are split into pages: perPage questions a page (0 for all on one), as "Repaginate" does, or page breaks exactly after the slots in breaksAfter. Returns the quiz's structure. Changes the quiz: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
quizId | ✅ | integer | The quiz's id (course module id), as get_course_structure gives it |
perPage | integer | Questions per page; 0 for one page | |
breaksAfter | integer list | Or: a page break after each of these slots, and nowhere else |
add_quiz_section
Add a section to a quiz
Add a section heading to a quiz, starting at a slot (the first of its page: see set_quiz_pages), optionally shuffling its questions. Returns the new section's id and the quiz's structure. Changes the quiz: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
quizId | ✅ | integer | The quiz's id (course module id), as get_course_structure gives it |
firstSlot | ✅ | integer | The slot's place in the quiz, from 1, as get_quiz_structure gives it |
heading | ✅ | string | |
shuffle | boolean |
get_quiz_results
Get a quiz's results
Read a quiz's attempts as its grades report shows them: per attempt the participant (an alias when the server pseudonymizes), state, dates, grade and the mark per question; with responses, also each answer given (redacted when pseudonymizing). A page at a time: limit attempts (50 by default) after skipping offset; more says whether there are others.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
quizId | ✅ | integer | The quiz's id (course module id), as get_course_structure gives it |
responses | boolean | Also the answer per question (default false) | |
limit | integer | How many attempts (50 by default, up to 500) | |
offset | integer | How many attempts to skip first, in the report's order (0 by default) |
get_quiz_statistics
Read a quiz's statistics
Read a quiz's statistics report, which tells which questions work: the quiz's figures (attempts, averages, median, standard deviation, skewness, kurtosis, internal consistency, error ratio, standard error) and per question its facility index, standard deviation, weights, discrimination index and efficiency, dubious ones marked; a random slot's questions and variants each with their own; with responses, how often each response was given (one page read per question). Figures as the report shows them. attempts chooses which attempts count; recalculate clears what Moodle stored. Aggregates only: no person.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
quizId | ✅ | integer | The quiz's id (course module id), as get_course_structure gives it |
attempts | highest, all, first, last | The quiz's grading method by default | |
recalculate | boolean | Calculate again now, for attempts finished since | |
responses | boolean | Also each question's analysis of responses |
set_quiz_override
Set a quiz override for a participant
Give a participant their own quiz settings, as the quiz's user overrides do: open and close dates, time limit in minutes, or number of attempts (0 unlimited); what isn't given stays the quiz's. Takes the participant as list_participants gives them. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
quizId | ✅ | integer | The quiz's id (course module id) |
user | string | The participant's alias, as the reading tools give it when the server pseudonymizes | |
userId | integer | The participant's user id, when the server shows names | |
open | string | ISO 8601 | |
close | string | ISO 8601 | |
timeLimitMinutes | integer | ||
attempts | integer | 0 for unlimited |
list_questions_to_grade
List a quiz's questions to grade by hand
List a quiz's questions that wait for grading by hand (essays…), each with how many to grade and the finished attempts whose answer needs it (by attempt id, with the participant as an alias when the server pseudonymizes). Read an answer with get_attempt_review; grade it with grade_quiz_question.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
quizId | ✅ | integer | The quiz's id (course module id) |
grade_quiz_question
Grade a quiz question by hand
Grade one question of a finished attempt by hand, with a comment, as the review's "Make comment or override mark" does: an essay waiting for grading, or any question whose mark is overridden. The mark is in the question's points (0 to its maximum). Returns the attempt's grade afterwards when shown. Students may see it: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
attemptId | ✅ | integer | As list_questions_to_grade gives it |
slot | ✅ | integer | |
mark | ✅ | number | |
comment | string | No aliases in it, since the student reads it |
Gradebook and progress
| Tool | Description | Read only | Teacher | Student |
|---|---|---|---|---|
get_grader_report | Get a course's grades | ✓ | ✓ | |
set_grade | Set a grade in the gradebook | ✓ | ||
export_grades | Export a course's grades to a file | ✓ | ✓ | |
get_gradebook_setup | Get a course's gradebook setup | ✓ | ✓ | |
add_grade_item | Add a manual grade item | ✓ | ||
update_grade_item | Update a grade item | ✓ | ||
delete_grade_item | Delete a manual grade item | ✓ | ||
add_grade_category | Add a grade category | ✓ | ||
update_grade_category | Update a grade category | ✓ | ||
delete_grade_category | Delete a grade category | ✓ | ||
import_grades | Import grades from a CSV file | ✓ | ||
list_scales | List a course's scales | ✓ | ✓ | |
add_scale | Add a scale to a course | ✓ | ||
edit_scale | Change a course's scale | ✓ | ||
get_grade_letters | Read a course's grade letters | ✓ | ✓ | |
set_grade_letters | Set a course's grade letters | ✓ | ||
get_completion_report | Get a course's activity completion | ✓ | ✓ | |
override_completion | Set a participant's activity completion | ✓ | ||
get_course_completion_criteria | Read a course's completion criteria | ✓ | ✓ | |
set_course_completion_criteria | Set what completes a course | ✓ | ||
get_course_completion_status | Read who has completed a course | ✓ | ✓ | |
mark_course_complete | Mark a participant's course completion | ✓ |
get_grader_report
Get a course's grades
Read everyone's grades in a course as the grader report shows them, in one group when given: its columns (grade items, categories, the course total) and a row per participant (an alias when the server pseudonymizes) with their grades.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
group | integer | Only this group's members, by its id from list_groups |
set_grade
Set a grade in the gradebook
Set a participant's grade in a grade item, as the gradebook's single view does: a manual item takes it; an activity's or a category's is overridden (until override false takes it off). Also feedback and excluding it from the totals. The grade as text: points ("7.5"), a scale item, or "none" to empty it. Students may see it: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
itemId | ✅ | integer | The grade item, as get_gradebook_setup or get_grader_report gives it |
user | string | The participant's alias, as the reading tools give it when the server pseudonymizes | |
userId | integer | The participant's user id, when the server shows names | |
grade | string | ||
feedback | string | No aliases in it, since the student reads it | |
override | boolean | false: take an activity's or category's override off | |
excluded | boolean | Exclude it from the totals |
export_grades
Export a course's grades to a file
Save a course's grades into a local folder as Moodle exports them for a teacher: a spreadsheet (xlsx, ods), CSV or XML, with the items, group, display and feedback chosen. The file names every participant: only with names in clear (the server's student data level), since a file can't be pseudonymized.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
format | ✅ | xlsx, ods, csv, xml | |
destDir | ✅ | string | An absolute local folder |
itemIds | integer list | Only these grade items | |
groupId | integer | ||
display | real, percentage, letter list | ||
feedback | boolean | Include feedback |
get_gradebook_setup
Get a course's gradebook setup
Read how a course's grades are computed, as the gradebook setup page shows it: its categories (aggregation, weight, maximum) and grade items (category, maximum, weight). No one's grades.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer |
add_grade_item
Add a manual grade item
Add a grade item graded in the gradebook (not by an activity): out of maxGrade (Moodle's default 100) or on a scale, at the top level or in a category, optionally hidden from students. Returns it as the setup shows it. Changes how grades are computed: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
name | ✅ | string | |
maxGrade | number | ||
scaleId | integer | A scale instead of points | |
categoryId | integer | The category to put it in, as get_gradebook_setup gives it | |
hidden | boolean |
update_grade_item
Update a grade item
Change a grade item from get_gradebook_setup: move it into a category, set its weight (percent, overriding the automatic one) or a manual item's maximum grade (an activity's is set in the activity). Returns the item afterwards. Changes how grades are computed: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
itemId | ✅ | integer | |
category | integer | The category to move it into | |
weight | number | Percent | |
maxGrade | number |
delete_grade_item
Delete a manual grade item
Delete a manual grade item and every grade in it. An activity's item goes with its activity, so it's refused. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
itemId | ✅ | integer |
add_grade_category
Add a grade category
Add a grade category to a course's gradebook, at the top level or inside another, with its aggregation. Returns it as the setup shows it. Changes how grades are computed: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
name | ✅ | string | |
aggregation | mean, median, lowest, highest, mode, weighted-mean, simple-weighted-mean, mean-with-extra-credits, natural | ||
parentId | integer | The category to put it in; the course's top level when missing |
update_grade_category
Update a grade category
Change a grade category from get_gradebook_setup: its name, aggregation, weight in its parent (percent, overriding the automatic one), or move it into another category. Returns it afterwards. Changes how grades are computed: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
categoryId | ✅ | integer | |
name | string | ||
aggregation | mean, median, lowest, highest, mode, weighted-mean, simple-weighted-mean, mean-with-extra-credits, natural | ||
weight | number | Percent | |
parentId | integer | The category to move it into |
delete_grade_category
Delete a grade category
Delete a grade category: Moodle moves what it held into its parent and deletes its total's grades; the course's own category can't be deleted. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
categoryId | ✅ | integer |
import_grades
Import grades from a CSV file
Import grades into a course's gradebook from a local CSV file, as Moodle's CSV import does: mapFrom is the column that identifies each person and mapTo what it holds (user id, username, ID number or email); items says which grade item (an id from get_gradebook_setup) each other column goes into, feedback which item's feedback. preview: true only shows how Moodle reads the file, importing nothing: do that first. Moodle imports all or nothing. The file identifies people: only with names in clear (the server's student data level). Changes grades students see: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
file | ✅ | string | An absolute local path to the CSV |
mapFrom | ✅ | string | The column (its header) that identifies each person |
mapTo | ✅ | id, username, idnumber, email | |
items | object | Column header → grade item id | |
feedback | object | Column header → the grade item whose feedback it is | |
preview | boolean | Only show how Moodle reads the file | |
separator | comma, semicolon, tab, colon | ||
encoding | string | One Moodle offers; UTF-8 by default |
list_scales
List a course's scales
List the scales a course's grades can use: its own and the site's standard ones, with their values and whether something grades with them.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer |
add_scale
Add a scale to a course
Add a scale to a course: its name and values from the lowest to the highest (no commas in them), and a description. Returns it. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
name | ✅ | string | |
items | ✅ | string list | |
description | string |
edit_scale
Change a course's scale
Change a course's scale: its name, values or description. A scale something grades with keeps its values. Returns it. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
scaleId | ✅ | integer | As list_scales gives it |
name | string | ||
items | string list | ||
description | string |
get_grade_letters
Read a course's grade letters
Read a course's grade letters, from the highest boundary to the lowest: its own when overridden, the site's defaults otherwise.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer |
set_grade_letters
Set a course's grade letters
Set a course's own grade letters, each from its minGrade percent, overriding the site's; useDefaults goes back to the site's. Changes how grades show to students: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
letters | object list | ||
useDefaults | boolean | The site's default letters instead |
get_completion_report
Get a course's activity completion
Read a course's progress report: every participant's completion (an alias when the server pseudonymizes) of every activity that tracks it, in one group when given; whether it's manual or automatic, and whether a teacher overrode it.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
group | integer | Only this group's members, by its id from list_groups |
override_completion
Set a participant's activity completion
Set a participant's completion of an activity as a teacher does from the progress report (an override, shown as such). Takes the participant as get_completion_report gives them. Returns the state saved. Changes the participant's progress: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The activity's id (course module id) |
user | string | The participant's alias, as the reading tools give it when the server pseudonymizes | |
userId | integer | The participant's user id, when the server shows names | |
state | ✅ | incomplete, complete, complete-pass, complete-fail |
get_course_completion_criteria
Read a course's completion criteria
Read what completes a course, from its "Course completion" settings: activities, other courses, a date, days enrolled, unenrolment, a course grade, self completion, roles that mark it, how they combine, what the form offers, whether completion is on and whether the criteria are locked. Course completion, not activity completion (get_completion_report).
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer |
set_course_completion_criteria
Set what completes a course
Set a course's completion criteria: a criterion given replaces that kind's settings, one in remove goes, one not given stays; overall says whether all criteria or any one complete the course. Activities need completion tracking, roles the right to mark completion (get_course_completion_criteria's offered lists both). Once someone has met a criterion Moodle locks them: unlock deletes every participant's course completion data first (not their activity completion). Returns the criteria. Confirm with the person first, and twice with unlock. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
overall | all, any | ||
activities | object | ||
courses | object | ||
date | string | Complete on this day | |
enrolmentDays | integer | 1 to 30, 40 to 180 by tens, or 365 | |
unenrolment | boolean | ||
grade | number | In the course total's points | |
self | boolean | ||
roles | object | ||
remove | activities, courses, date, enrolmentDays, grade, roles list | Criteria to take away | |
unlock | boolean | Unlock locked criteria first, deleting everyone's course completion data |
get_course_completion_status
Read who has completed a course
Read each participant's course completion from the course completion report: whether and when they completed the course, and each criterion met and when; participants as aliases when the server pseudonymizes. Some criteria (a grade, a date, days enrolled) are worked out by Moodle's scheduled tasks, so a criterion just met may not show yet. A page at a time: limit participants (50 by default) after skipping offset; more says whether there are others.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
user | string | The participant's alias, as the reading tools give it when the server pseudonymizes | |
userId | integer | The participant's user id, when the server shows names | |
groupId | integer | Only this group's participants | |
limit | integer | How many participants (50 by default, up to 200) | |
offset | integer | How many participants to skip first (0 by default) |
mark_course_complete
Mark a participant's course completion
Mark a participant's course completion by hand (an alias when the server pseudonymizes), as the course completion report's link does: the course's "Manual completion by others" criterion for a role the person holds. Moodle completes the course when the rest of the criteria allow it. Returns their completion afterwards. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
user | string | The participant's alias, as the reading tools give it when the server pseudonymizes | |
userId | integer | The participant's user id, when the server shows names |
Badges
| Tool | Description | Read only | Teacher | Student |
|---|---|---|---|---|
list_badges | List a course's badges | ✓ | ✓ | ✓ |
create_badge | Create a course badge | ✓ | ||
set_badge_criteria | Set what earns a badge | ✓ | ||
set_badge_enabled | Enable or disable a badge | ✓ | ||
award_badge | Award a badge by hand | ✓ |
list_badges
List a course's badges
List a course's badges: name, description, image, what earns it (Moodle's summary), whether it's enabled and whether the person has it; for a teacher, disabled badges too and how many people have each. Fails with a clear error where the site has badges turned off.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer |
create_badge
Create a course badge
Create a course badge, disabled and without criteria, through Moodle's new badge form: its name, description (plain text) and image (a local PNG, JPEG or GIF, at most 256 KB). Then set_badge_criteria gives it criteria and set_badge_enabled makes it available. Returns the badge. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
name | ✅ | string | |
description | ✅ | string | Plain text: Moodle strips tags |
image | ✅ | string | An absolute local path to its image: PNG, JPEG or GIF, at most 256 KB |
imageCaption | string | The image's alternative text |
set_badge_criteria
Set what earns a badge
Set a badge's criteria: completing activities (with completion tracking; all of them or any one), completing the course (with a minimum course grade and a date), or awarded by hand by people with some roles (any one of them by default); all says whether every criterion must be met or any one. A criterion given replaces that kind's settings, one in remove goes, one not given stays. Moodle lets criteria change only while the badge is disabled and nobody has it. Returns the criteria. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
badgeId | ✅ | integer | The badge's id, as list_badges gives it |
activities | object | ||
courseCompletion | object | ||
manual | object | ||
all | boolean | With more than one criterion: all must be met, or any one | |
remove | activities, courseCompletion, manual list | Criteria to take away |
set_badge_enabled
Enable or disable a badge
Make a badge available to users or not. Enabling it awards it at once to everyone who already meets its criteria, and they're told: confirm with the person first. It needs criteria first. Returns the badge.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
badgeId | ✅ | integer | The badge's id, as list_badges gives it |
enabled | ✅ | boolean |
award_badge
Award a badge by hand
Award a badge by hand to a participant (an alias when the server pseudonymizes), as one of the roles its manual criterion names (roleId when the person holds several). The badge must be enabled and have a manual criterion. Moodle issues it at once when the manual award is enough, else once the rest of its criteria are met. The participant is told: confirm with the person first. Returns the badge.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
badgeId | ✅ | integer | The badge's id, as list_badges gives it |
user | string | The participant's alias, as the reading tools give it when the server pseudonymizes | |
userId | integer | The participant's user id, when the server shows names | |
roleId | integer | The role to award it as |
Advanced tools (MOODLE_MCP_ADVANCED)
These are off by default, for areas few people use: MOODLE_MCP_ADVANCED=true turns them on, and the other limits still apply. See Limiting the agent.
| Tool | Description | Read only | Teacher | Student |
|---|---|---|---|---|
list_course_blocks | List a course page's blocks | ✓ | ✓ | |
add_block | Add a block to a course page | ✓ | ||
configure_block | Configure a course page's block | ✓ | ||
move_block | Move a course page's block | ✓ | ||
delete_block | Delete a course page's block | ✓ | ||
list_content_bank | List a course's content bank | ✓ | ✓ | |
upload_to_content_bank | Upload H5P content to a course's content bank | ✓ | ||
rename_content | Rename content in a content bank | ✓ | ||
download_content | Download content from a content bank | ✓ | ||
delete_content | Delete content from a content bank | ✓ | ||
get_bigbluebutton | Read a BigBlueButton activity | ✓ | ✓ | ✓ |
get_bigbluebutton_join_url | Get the link to join a BigBlueButton meeting | ✓ | ✓ | ✓ |
set_recording_published | Publish or hide a BigBlueButton recording | ✓ | ||
delete_recording | Delete a BigBlueButton recording | ✓ | ||
list_notes | Read notes about a course's participants | ✓ | ✓ | |
add_note | Write a note about a participant | ✓ | ||
edit_note | Change a note about a participant | ✓ | ||
delete_note | Delete a note about a participant | ✓ | ||
list_competency_frameworks | List the competency frameworks a course can use | ✓ | ✓ | |
list_course_competencies | List a course's competencies | ✓ | ✓ | |
add_course_competency | Add a competency to a course | ✓ | ||
remove_course_competency | Remove a competency from a course | ✓ | ||
set_activity_competencies | Link competencies to an activity | ✓ | ||
get_competency_rating | Read a participant's rating in a competency | ✓ | ✓ | ✓ |
rate_competency | Rate a participant in a competency | ✓ | ||
list_external_tools | List a course's external tools | ✓ | ✓ | |
add_external_tool | Add an external tool to a course | ✓ | ||
set_external_tool_in_chooser | Show an external tool in the activity chooser | ✓ | ||
delete_external_tool | Delete a course's external tool | ✓ | ||
get_external_tool_launch_url | Get the link that launches an LTI activity | ✓ | ✓ | ✓ |
list_course_blocks
List a course page's blocks
List the blocks on a course's page: type, title, region, order and visibility, and a text block's content.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer |
add_block
Add a block to a course page
Add a block to a course's page: a text block (type html) with its title and HTML content (local images embedded), or another core block by its type (calendar_upcoming, recent_activity…), in a region or the page's default. Returns the block. Everyone in the course sees it: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
type | ✅ | string | html for a text block, or another block's plugin name |
region | string | ||
title | string | ||
content | string | A text block's HTML | |
embed | string list | Absolute local files the content names, which go in it: <img src="shot.png"> |
configure_block
Configure a course page's block
Change a block: a text block's title and content, or any field of its configure form by name in settings (bui_visible, config_…). Returns the block. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
blockId | ✅ | integer | The block's id, as list_course_blocks gives it |
title | string | ||
content | string | ||
embed | string list | Absolute local files the content names, which go in it: <img src="shot.png"> | |
settings | object | Other fields of the block's configure form, by name |
move_block
Move a course page's block
Move a block to another region or place in it (weight: lower comes first). Returns the block. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
blockId | ✅ | integer | The block's id, as list_course_blocks gives it |
region | string | ||
weight | integer |
delete_block
Delete a course page's block
Delete a block from a course's page, with its configuration. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
blockId | ✅ | integer | The block's id, as list_course_blocks gives it |
list_content_bank
List a course's content bank
List a course's content bank: each content's name, H5P library, author, date, size, how many activities use it and whether it's unlisted.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer |
upload_to_content_bank
Upload H5P content to a course's content bank
Upload a local .h5p file to a course's content bank, where H5P activities can use it. Returns the content. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
file | ✅ | string | An absolute local path to the .h5p file |
rename_content
Rename content in a content bank
Rename a content of a content bank. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
contentId | ✅ | integer | The content's id, as list_content_bank gives it |
name | ✅ | string |
download_content
Download content from a content bank
Save a content bank's content (its .h5p file) into a local folder.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
contentId | ✅ | integer | The content's id, as list_content_bank gives it |
destDir | ✅ | string | An absolute local folder |
delete_content
Delete content from a content bank
Delete a content of a content bank. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
contentId | ✅ | integer | The content's id, as list_content_bank gives it |
get_bigbluebutton
Read a BigBlueButton activity
Read a BigBlueButton activity: whether it's not open yet, open, running or closed, its schedule, who's in it while running (counts), whether the person can join and as moderator, and its recordings (all for who manages them, the published ones for the rest). Fails with a clear error where the site's BigBlueButton server isn't set up.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The BigBlueButton activity's id (course module id), as get_course_structure gives it |
get_bigbluebutton_join_url
Get the link to join a BigBlueButton meeting
Give the link that joins the person to a BigBlueButton meeting, for them to open; nothing is joined here. The link is the person's own: give it to them, not to anyone else.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The BigBlueButton activity's id (course module id), as get_course_structure gives it |
set_recording_published
Publish or hide a BigBlueButton recording
Publish a BigBlueButton recording to students, or hide it from them. Returns the recording. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The BigBlueButton activity's id (course module id), as get_course_structure gives it |
recordingId | ✅ | integer | The recording's id, as get_bigbluebutton gives it |
published | ✅ | boolean |
delete_recording
Delete a BigBlueButton recording
Delete a BigBlueButton recording. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The BigBlueButton activity's id (course module id), as get_course_structure gives it |
recordingId | ✅ | integer | The recording's id, as get_bigbluebutton gives it |
list_notes
Read notes about a course's participants
Read the notes about a course's participants, or one participant's: who it's about and who wrote it (aliases when the server pseudonymizes), its content, whether it's personal, course or site, and whether the person may change it. A page at a time: limit notes (50 by default) after skipping offset; more says whether there are others.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
user | string | The participant's alias, as the reading tools give it when the server pseudonymizes | |
userId | integer | The participant's user id, when the server shows names | |
limit | integer | How many notes (50 by default, up to 200) | |
offset | integer | How many notes to skip first (0 by default) |
add_note
Write a note about a participant
Write a note about a participant (an alias when the server pseudonymizes): its content (HTML, no aliases in it) and who sees it. Returns the note. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
user | string | The participant's alias, as the reading tools give it when the server pseudonymizes | |
userId | integer | The participant's user id, when the server shows names | |
content | ✅ | string | |
context | personal, course, site | personal: only its author sees it; course: the course's teachers; site: teachers in any course |
edit_note
Change a note about a participant
Change a note's content (no aliases in it) or who sees it. Returns the note. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
noteId | ✅ | integer | The note's id, as list_notes gives it |
content | string | ||
context | personal, course, site | personal: only its author sees it; course: the course's teachers; site: teachers in any course |
delete_note
Delete a note about a participant
Delete a note. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
noteId | ✅ | integer | The note's id, as list_notes gives it |
list_competency_frameworks
List the competency frameworks a course can use
List the competency frameworks a course can draw its competencies from, each with its competencies (id, short name, ID number, description, parent). Fails with a clear error where the site has competencies turned off.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer |
list_course_competencies
List a course's competencies
List a course's competencies, each with its framework and the course's activities linked to it.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer |
add_course_competency
Add a competency to a course
Add a framework's competency to a course. Returns the course's competencies. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
competencyId | ✅ | integer | The competency's id, as list_competency_frameworks or list_course_competencies gives it |
remove_course_competency
Remove a competency from a course
Remove a competency from a course, and its links to the course's activities. Returns the course's competencies. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
competencyId | ✅ | integer | The competency's id, as list_competency_frameworks or list_course_competencies gives it |
set_activity_competencies
Link competencies to an activity
Set the course competencies linked to an activity: the list given replaces its links ([] removes them). Returns the activity's competencies. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | As get_course_structure gives it |
competencyIds | ✅ | integer list | The course's competencies, as list_course_competencies gives them |
get_competency_rating
Read a participant's rating in a competency
Read a participant's rating in a course competency (an alias when the server pseudonymizes; the person's own without one): the rating, whether proficient, the scale, the evidence in the course (latest first) and whether the person may rate them.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
competencyId | ✅ | integer | The competency's id, as list_competency_frameworks or list_course_competencies gives it |
user | string | The participant's alias, as the reading tools give it when the server pseudonymizes | |
userId | integer | The participant's user id, when the server shows names |
rate_competency
Rate a participant in a competency
Rate a participant (an alias when the server pseudonymizes) in a course competency: a value of its scale (1 for the first) or the item's name, with a note kept as evidence (no aliases in it). Returns the rating. The participant sees it: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
competencyId | ✅ | integer | The competency's id, as list_competency_frameworks or list_course_competencies gives it |
user | string | The participant's alias, as the reading tools give it when the server pseudonymizes | |
userId | integer | The participant's user id, when the server shows names | |
rating | ✅ | string | The scale item's value ("2") or name |
note | string |
list_external_tools
List a course's external tools
List the external tools (LTI) a course may use: those an administrator set up for the site and the course's own, each with whether teachers find it in the activity chooser. create_activity makes an LTI activity from one by its id (type lti, toolId).
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer |
add_external_tool
Add an external tool to a course
Add an external tool (LTI 1.0/1.1) to a course by its launch URL, with the consumer key and shared secret its provider gave (Moodle stores the secret; nothing gives it back), and any other field of Moodle's course tool form by name. Returns the tool. A tool sends the course's people to another site: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
name | ✅ | string | |
url | ✅ | string | The tool's launch URL, or a cartridge's |
description | string | ||
key | string | The consumer key | |
secret | string | The shared secret | |
settings | object | Other fields of the course tool form, by name (lti_launchcontainer, lti_sendname…) |
set_external_tool_in_chooser
Show an external tool in the activity chooser
Show a course's external tool in the activity chooser, or keep it out. Returns the tool. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
toolId | ✅ | integer | The tool's id, as list_external_tools gives it |
shown | ✅ | boolean |
delete_external_tool
Delete a course's external tool
Delete one of the course's own external tools. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
toolId | ✅ | integer | The tool's id, as list_external_tools gives it |
get_external_tool_launch_url
Get the link that launches an LTI activity
Give the link that launches an LTI activity for the person, for them to open; nothing is launched here. The link is the person's own: give it to them, not to anyone else.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The LTI activity's id (course module id), as get_course_structure gives it |
Reports
| Tool | Description | Read only | Teacher | Student |
|---|---|---|---|---|
get_activity_report | Get a course's activity views | ✓ | ✓ | |
get_participation_report | Get who took part in an activity | ✓ | ✓ | |
get_course_logs | Get a course's logs | ✓ | ✓ | |
get_choice_results | Read a choice's results | ✓ | ✓ | |
get_survey_results | Read a survey's results | ✓ | ✓ |
get_activity_report
Get a course's activity views
Read a course's activity report: per activity, how many times it was viewed, by how many people and when last, from the logs (between from and until when given). Counts only, no one's name. Activities nobody viewed come with zero.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
from | string | ISO 8601 | |
until | string | ISO 8601 |
get_participation_report
Get who took part in an activity
Read an activity's participation report: everyone with a role (all the roles it offers, unless roleId) and how many actions they made there (views or posts only with action; since a date with since); those who did nothing come with 0. People as aliases when the server pseudonymizes.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
activityId | ✅ | integer | |
roleId | integer | ||
since | string | ISO 8601 | |
action | view, post |
get_course_logs
Get a course's logs
Read a course's logs, newest first, as its logs report lists them: by a user (an alias when the server pseudonymizes), an activity, a kind of action and a time span, a page at a time: limit entries (50 by default) after skipping offset; more says whether there are others. Each entry: when, who, who it was about, where, what happened (Moodle's longer description only with includeDescriptions). Never IP addresses.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
user | string | The participant's alias, as the reading tools give it when the server pseudonymizes | |
userId | integer | The participant's user id, when the server shows names | |
activityId | integer | ||
action | create, view, update, delete, change | ||
from | string | ISO 8601 | |
until | string | ISO 8601 | |
limit | integer | How many entries (50 by default) | |
offset | integer | How many entries to skip first, newest first (0 by default) | |
includeDescriptions | boolean | Also each entry's description, Moodle's sentence about it (longer; default false) |
get_choice_results
Read a choice's results
Read a choice's responses as its report shows a teacher: each option with how many chose it and who (aliases when the server pseudonymizes), and who hasn't answered where the choice shows that. The report names people whatever the choice publishes to students.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
choiceId | ✅ | integer | The activity's id (course module id), as get_course_structure gives it |
get_survey_results
Read a survey's results
Read what people answered in a feedback or a questionnaire, as its reports show a teacher: every response (who gave it, an alias when the server pseudonymizes, none when anonymous) and, per question, each response's answer (text redacted when pseudonymizing), the counts of a choice question's options and the average of numeric and rated ones. A questionnaire lists its responses only once someone has answered.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The activity's id (course module id), as get_course_structure gives it |
type | questionnaire, feedback | The activity's type, as get_course_structure gives it; found when missing |
Participants and groups
| Tool | Description | Read only | Teacher | Student |
|---|---|---|---|---|
list_participants | List a course's participants | ✓ | ✓ | ✓ |
list_potential_users | Find users to enrol | ✓ | ✓ | |
enrol_users | Enrol users in a course | ✓ | ||
unenrol_user | Unenrol a user from a course | ✓ | ||
set_user_roles | Set someone's roles in a course | ✓ | ||
list_enrolment_methods | List a course's enrolment methods | ✓ | ✓ | |
set_enrolment_method | Set an enrolment method | ✓ | ||
list_groups | List a course's groups | ✓ | ✓ | ✓ |
create_group | Create a group | ✓ | ||
update_group | Change a group | ✓ | ||
delete_group | Delete a group | ✓ | ||
set_group_members | Add or remove a group's members | ✓ | ||
list_groupings | List a course's groupings | ✓ | ✓ | |
create_grouping | Create a grouping | ✓ | ||
delete_grouping | Delete a grouping | ✓ | ||
set_grouping_groups | Set a grouping's groups | ✓ | ||
auto_create_groups | Create groups automatically | ✓ | ||
import_groups | Import groups from a CSV file | ✓ |
list_participants
List a course's participants
List a course's participants with their roles and groups, as the participants page does: people as aliases when the server pseudonymizes, never emails or profile fields. Filter by role, group, or those who haven't accessed the course since a date (inactiveSince). A page at a time: limit participants (50 by default) after skipping offset; more says whether there are others.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
role | integer | Only this role's, by its id (as the participants' roles give it) | |
group | integer | Only this group's members, by its id from list_groups | |
inactiveSince | string | Only those who haven't accessed the course since this date (ISO 8601) | |
limit | integer | How many participants (50 by default, up to 500) | |
offset | integer | How many participants to skip first (0 by default) |
list_potential_users
Find users to enrol
Find users the person may enrol in a course by manual enrolment, as the "Enrol users" dialog does: matching search in their name or the identity fields the site shows (up to 100 when empty). People as aliases when the server pseudonymizes, never their emails. Enrol them with enrol_users.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
search | string | Part of a name, an email, an ID number… |
enrol_users
Enrol users in a course
Enrol users in a course by manual enrolment, as the "Enrol users" dialog does: with a role (the enrolment's default unless roleId), from start (now) until end (the enrolment's default duration). Takes them as list_potential_users gives them. Those already enrolled keep their enrolment, with the new dates. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
users | string list | The participants' aliases, as the reading tools give them when the server pseudonymizes | |
userIds | integer list | The participants' user ids, when the server shows names | |
roleId | integer | The role to give, as list_participants' roles give it | |
start | string | ISO 8601 | |
end | string | ISO 8601 |
unenrol_user
Unenrol a user from a course
Unenrol someone from a course: removes every enrolment of theirs the person may remove, with their roles and group memberships in the course; removed and kept name the enrolment methods. Their work in the course stays in Moodle but they lose access. Confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
user | string | The participant's alias, as the reading tools give it when the server pseudonymizes | |
userId | integer | The participant's user id, when the server shows names |
set_user_roles
Set someone's roles in a course
Set a participant's roles in a course, as the participants page's roles column does: gives the roles in roleIds the person may assign and takes away the other ones they may assign; roles from elsewhere stay. Returns the roles afterwards. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
user | string | The participant's alias, as the reading tools give it when the server pseudonymizes | |
userId | integer | The participant's user id, when the server shows names | |
roleIds | ✅ | integer list | Role ids, as list_participants' roles give them |
list_enrolment_methods
List a course's enrolment methods
List how people can enrol in a course, in the order Moodle tries them: each method's type, name, whether it's on, how many it enrolled, the role it gives and, for self enrolment and guest access, whether it asks for a key (never the key), dates and limit.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer |
set_enrolment_method
Set an enrolment method
Change an enrolment method with its form, by its id or the course's first of a type (methodType "self": added when the course has none and Moodle offers it): turn it on or off, its key, dates, role, limit and welcome message. Only what's given changes. Returns the method afterwards (never the key). Opens or closes the course to people: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
methodId | integer | As list_enrolment_methods gives it | |
methodType | string | Or the method's type, such as "self" or "guest" | |
enabled | boolean | ||
key | string | Self enrolment or guest access key; empty to remove it | |
start | string | From when, ISO 8601; "none" to remove it | |
end | string | Until when, ISO 8601; "none" to remove it | |
roleId | integer | ||
maxUsers | integer | 0 for no limit | |
welcomeMessage | string | Self enrolment: send this welcome message | |
noWelcome | boolean | Self enrolment: send no welcome message |
list_groups
List a course's groups
List the groups of a course the person can see, with their members (as aliases when the server pseudonymizes). Their ids are what the reports' group filter takes.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer |
create_group
Create a group
Create a group in a course with Moodle's group form. Add its members with set_group_members. Returns its id. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
name | ✅ | string | |
description | string | HTML | |
idNumber | string | An id for external systems | |
enrolmentKey | string | A key that enrols students straight into this group with self enrolment |
update_group
Change a group
Change a group's name, description, ID number or enrolment key; what isn't given stays. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
groupId | ✅ | integer | The group's id, as list_groups gives it |
name | string | ||
description | string | HTML | |
idNumber | string | An id for external systems | |
enrolmentKey | string | A key that enrols students straight into this group with self enrolment |
delete_group
Delete a group
Delete a group; its members stay in the course. Activities set to work by groups lose it. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
groupId | ✅ | integer | The group's id, as list_groups gives it |
set_group_members
Add or remove a group's members
Add and remove members of a group, as its members page does: only the course's participants can be added. Takes them as list_participants gives them: aliases (add, remove) when the server pseudonymizes, else user ids (addIds, removeIds). Returns the members afterwards. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | The group's course |
groupId | ✅ | integer | As list_groups gives it |
add | string list | Aliases to add, when the server pseudonymizes | |
remove | string list | Aliases to remove, when the server pseudonymizes | |
addIds | integer list | User ids to add, when the server shows names | |
removeIds | integer list | User ids to remove, when the server shows names |
list_groupings
List a course's groupings
List a course's groupings (sets of groups an activity can be limited to) with their groups' ids. Needs the right to manage groups.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer |
create_grouping
Create a grouping
Create a grouping in a course with Moodle's form; give it its groups with set_grouping_groups. Returns its id. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
name | ✅ | string | |
description | string | HTML | |
idNumber | string |
delete_grouping
Delete a grouping
Delete a grouping; its groups stay. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
groupingId | ✅ | integer | The grouping's id, as list_groupings gives it |
set_grouping_groups
Set a grouping's groups
Make a grouping's groups exactly groupIds, adding and removing as its page does; groups of other courses are left out and named. Returns its groups afterwards. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
groupingId | ✅ | integer | The grouping's id, as list_groupings gives it |
groupIds | ✅ | integer list |
auto_create_groups
Create groups automatically
Split a course's participants into groups at once, as Moodle's "Auto-create groups" does: count groups, or groups of count members, named by naming (# a number, @ a letter), filled at random or by name or ID number (or left empty), from a role (students by default), a cohort, a grouping or a group, optionally into an existing or new grouping. preview: true shows the groups and members Moodle would make and creates nothing: do that first, then give its seed back to create those same groups. Members as aliases when the server pseudonymizes. Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
by | ✅ | groups, members | groups: count groups; members: groups of count members |
count | ✅ | integer | |
naming | ✅ | string | The groups' names: # becomes their number, @ a letter ("Group @") |
allocation | random, firstname, lastname, idnumber, none | random by default; none leaves them empty | |
roleId | integer | Only this role (0: every role); students by default | |
cohortId | integer | ||
fromGroupingId | integer | ||
fromGroupId | integer | ||
notInGroup | boolean | Only participants in no group yet | |
noSmallGroups | boolean | With members: spread a last group that would be too small over the others | |
groupingId | integer | Put them in this grouping | |
newGrouping | string | Or in a new grouping of this name | |
preview | boolean | ||
seed | integer | A preview's seed, to create those same groups |
import_groups
Import groups from a CSV file
Create groups from a local CSV file, as Moodle's "Import groups" does: a groupname column, and optionally description, enrolmentkey, groupidnumber, groupingname (made when missing) and enablemessaging. Moodle creates the groups without members. Returns the new groups and Moodle's messages for the rows it skipped. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
file | ✅ | string | An absolute local path to the CSV |
delimiter | comma, semicolon, colon, tab |
Forums, workshops and messages
| Tool | Description | Read only | Teacher | Student |
|---|---|---|---|---|
list_discussions | List a forum's discussions | ✓ | ✓ | ✓ |
get_discussion | Read a forum discussion | ✓ | ✓ | ✓ |
reply_to_post | Reply to a forum post | ✓ | ✓ | |
create_discussion | Start a forum discussion | ✓ | ✓ | |
edit_post | Edit a forum post | ✓ | ✓ | |
delete_post | Delete a forum post | ✓ | ✓ | |
set_discussion_state | Pin or lock a discussion | ✓ | ||
set_discussion_subscription | Subscribe to a forum discussion | ✓ | ✓ | |
get_forum_grades | Get a forum's whole-forum grades | ✓ | ✓ | |
grade_forum_user | Give a whole-forum grade | ✓ | ||
rate | Rate a post, entry or record | ✓ | ✓ | |
get_workshop | Read a workshop | ✓ | ✓ | |
set_workshop_phase | Switch a workshop's phase | ✓ | ||
assess_workshop_submission | Assess a workshop submission | ✓ | ✓ | |
get_workshop_submission | Read a workshop submission | ✓ | ✓ | ✓ |
save_workshop_submission | Submit to a workshop | ✓ | ✓ | |
list_workshop_examples | List a workshop's example submissions | ✓ | ✓ | |
add_workshop_example | Add an example submission to a workshop | ✓ | ||
edit_workshop_example | Change a workshop's example submission | ✓ | ||
delete_workshop_example | Delete a workshop's example submission | ✓ | ||
assess_workshop_example | Assess a workshop's example submission | ✓ | ✓ | |
calculate_workshop_grades | Calculate a workshop's grades | ✓ | ||
override_workshop_grade | Override a workshop grade | ✓ | ||
get_workshop_allocation | Read who assesses whom in a workshop | ✓ | ✓ | |
allocate_workshop_reviewer | Allocate a reviewer to a workshop submission | ✓ | ||
remove_workshop_reviewer | Remove a reviewer from a workshop submission | ✓ | ||
allocate_workshop_randomly | Allocate a workshop's reviewers at random | ✓ | ||
schedule_workshop_allocation | Schedule a workshop's random allocation | ✓ | ||
list_notifications | List my notifications | ✓ | ✓ | ✓ |
mark_notifications_read | Mark my notifications read | ✓ | ✓ | |
list_conversations | List my conversations | ✓ | ✓ | ✓ |
get_conversation | Read a conversation | ✓ | ✓ | ✓ |
send_message | Send a private message | ✓ | ✓ | |
message_participants | Message several participants | ✓ |
list_discussions
List a forum's discussions
List the discussions of a Moodle forum: subject, who started it and when, the last post's author and time, the number of replies (0: unanswered) and whether it's locked. A page at a time: limit discussions (30 by default) after skipping offset; more says whether there are others. Takes the forum id from get_course_structure; read one with get_discussion.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
forumId | ✅ | integer | The forum's id (its course module id), as get_course_structure gives it |
limit | integer | How many discussions (30 by default, up to 100) | |
offset | integer | How many discussions to skip first, in the forum's order (0 by default) |
get_discussion
Read a forum discussion
Read a Moodle forum discussion's posts, oldest first, a page at a time (limit posts, 50 by default, after skipping offset; more says whether there are others): author (an alias when the server pseudonymizes), time, the post it replies to, the message as plain text (names and contact data redacted when pseudonymizing) and attachments. Takes the discussion id from list_discussions.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
discussionId | ✅ | integer | The discussion id, as list_discussions gives it |
limit | integer | How many posts (50 by default, up to 200) | |
offset | integer | How many posts to skip first, oldest first (0 by default) |
reply_to_post
Reply to a forum post
Reply to a post in a Moodle forum discussion, with optional attachments (local files). The subject defaults to Moodle's "Re: …". Returns the new post's id and its discussion. Posts as the person, visibly: confirm the text with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
postId | ✅ | integer | The post to reply to, as get_discussion gives it |
subject | string | ||
message | ✅ | string | The message (HTML); no aliases in it, since people read it |
files | string list | Absolute local paths to attach | |
embed | string list | Absolute local files (images…) to embed in the HTML, which names each by its file name: <img src="shot.png"> | |
subscribe | boolean | Subscribe to the discussion; Moodle's default when missing | |
fields | object | Other post form fields by name, e.g. {"pinned": true} for a teacher |
create_discussion
Start a forum discussion
Start a discussion in a Moodle forum, with optional attachments and embedded images (local files); a teacher can post announcements this way in the announcements forum. Returns the new discussion's id, and whether it's pinned and the person subscribed, read back. Posts as the person, visibly: confirm the text with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
forumId | ✅ | integer | The forum's id (course module id), as get_course_structure gives it |
subject | ✅ | string | |
message | ✅ | string | The message (HTML); no aliases in it, since people read it |
files | string list | Absolute local paths to attach | |
embed | string list | Absolute local files (images…) to embed in the HTML, which names each by its file name: <img src="shot.png"> | |
subscribe | boolean | Subscribe to the discussion; Moodle's default when missing | |
fields | object | Other post form fields by name, e.g. {"pinned": true} for a teacher |
edit_post
Edit a forum post
Change a forum post through Moodle's own form, as its author (within the site's editing time) or a moderator: its subject, message (HTML), and attachments to add or remove. Only what's given changes. Returns the post afterwards (its author as an alias when the server pseudonymizes). Visible to the forum: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
postId | ✅ | integer | As get_discussion gives it |
subject | string | ||
message | string | HTML; no aliases in it, since people read it | |
addFiles | string list | Absolute local paths to attach | |
removeFiles | string list | Attachments' names to remove | |
embed | string list | Absolute local files (images…) to embed in the HTML, which names each by its file name: <img src="shot.png"> |
delete_post
Delete a forum post
Delete a forum post and its replies through Moodle's own confirmation; a discussion's first post takes the whole discussion. Only a moderator deletes someone else's post or one with replies. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
postId | ✅ | integer | As get_discussion gives it |
set_discussion_state
Pin or lock a discussion
Pin or unpin, lock or unlock a forum discussion, as the discussion list's menu does; what's already so is left alone. Returns the discussion as the forum lists it afterwards. Students see it: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
forumId | ✅ | integer | The forum's id (course module id), as get_course_structure gives it |
discussionId | ✅ | integer | As list_discussions gives it |
pinned | boolean | ||
locked | boolean |
set_discussion_subscription
Subscribe to a forum discussion
Subscribe the person to a forum discussion, or unsubscribe them, as the discussion list's toggle does: Moodle then emails them its new posts. What's already so is left alone. Returns the discussion as the forum lists it afterwards.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
forumId | ✅ | integer | The forum's id (course module id), as get_course_structure gives it |
discussionId | ✅ | integer | As list_discussions gives it |
subscribed | ✅ | boolean |
get_forum_grades
Get a forum's whole-forum grades
Read the whole-forum grades of a forum graded as a whole, as its grader shows them: one per person it can grade (aliases when the server pseudonymizes), with how it's graded (points or scale) and who graded.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
forumId | ✅ | integer | The forum's id (course module id) |
groupId | integer |
grade_forum_user
Give a whole-forum grade
Give a participant their whole-forum grade, as the forum's grader does: points ("7"), a scale item, or "none" to take it away; notify sends them Moodle's notification. Students may see it: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
forumId | ✅ | integer | The forum's id (course module id) |
user | string | The participant's alias, as the reading tools give it when the server pseudonymizes | |
userId | integer | The participant's user id, when the server shows names | |
grade | ✅ | string | |
notify | boolean |
rate
Rate a post, entry or record
Rate a forum post, a glossary entry or a database record as the person, as the rating menu under it does: a scale item's name, or a number (a point scale's points); "none" takes the person's rating away. Returns the item's aggregate afterwards. Students may see it: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
itemType | ✅ | forum-post, glossary-entry, database-record | |
itemId | ✅ | integer | The post's, entry's or record's id |
discussionId | integer | For a forum post: its discussion | |
rating | ✅ | string |
get_workshop
Read a workshop
Read a workshop's phase and its report as a teacher sees it: every submission (author, title, grade once calculated) and every assessment (reviewer, the submission's author, the grade it gives, its weight, the grade for assessing). People as aliases when the server pseudonymizes. Empty lists before the submission phase, or for someone who can't see every submission.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
workshopId | ✅ | integer | The workshop's id (course module id) |
set_workshop_phase
Switch a workshop's phase
Switch a workshop to a phase (setup, submission, assessment, evaluation, closed), forwards or back, as its page's phase links do. Moodle allocates nothing and calculates no grades on its own when it switches. Changes what students can do: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
workshopId | ✅ | integer | The workshop's id (course module id) |
phase | ✅ | setup, submission, assessment, evaluation, closed |
assess_workshop_submission
Assess a workshop submission
Assess a workshop submission as the person, through the workshop's assessment form (its grading strategy's): a grade and comment per criterion in the form's order, overall feedback for the author (HTML), and any other field by name. A new assessment the first time, the same one changed after. Only in the assessment phase. Returns the grade it gives. The author reads it: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
workshopId | ✅ | integer | The workshop's id (course module id) |
submissionId | ✅ | integer | As get_workshop gives it |
criteria | object list | In the form's order | |
feedback | string | Overall feedback for the author (HTML); no aliases in it | |
fields | object | Any other field of the form, by name |
get_workshop_submission
Read a workshop submission
Read a workshop submission as its page shows it: title, text (HTML), attached files, author (an alias when the server pseudonymizes, where Moodle shows authors) and whether the person can edit it now. Without submissionId or author, the person's own (none when they haven't submitted); a teacher reads anyone's, a reviewer those allocated to them.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
workshopId | ✅ | integer | The workshop's id (course module id) |
submissionId | integer | As get_workshop gives it | |
author | string | Or its author's alias, when the server pseudonymizes | |
authorId | integer | Or its author's user id, when the server shows names |
save_workshop_submission
Submit to a workshop
Add the person's submission to a workshop, or change the one they have, through its submission form: title, text (HTML, with local images embedded), attached local files; only what is given changes (a new one needs a title). Moodle takes it in the submission phase, within its dates. Returns the submission. Reviewers will read it: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
workshopId | ✅ | integer | The workshop's id (course module id) |
title | string | Its title; a new one needs it | |
content | string | Its text (HTML), where the workshop takes online text; no aliases in it | |
attachments | string list | Absolute local paths: they replace the files attached before | |
embed | string list | Absolute local files to embed in the text, which names each by its file name: <img src="shot.png"> |
list_workshop_examples
List a workshop's example submissions
List a workshop's example submissions as its page shows a teacher: title, and whether its reference assessment is made, with its grade. Moodle lists them in the setup phase, where the workshop uses examples.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
workshopId | ✅ | integer | The workshop's id (course module id) |
add_workshop_example
Add an example submission to a workshop
Add an example submission to a workshop, for participants to practise assessing: title, text (HTML, with local images embedded) and attached files. Then assess_workshop_example makes its reference assessment. Only where the workshop uses examples. Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
workshopId | ✅ | integer | The workshop's id (course module id) |
title | ✅ | string | |
content | string | Its text (HTML), where the workshop takes online text; no aliases in it | |
attachments | string list | Absolute local paths: they replace the files attached before | |
embed | string list | Absolute local files to embed in the text, which names each by its file name: <img src="shot.png"> |
edit_workshop_example
Change a workshop's example submission
Change an example submission: only what is given (attachments replace those there). Changes the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
workshopId | ✅ | integer | The workshop's id (course module id) |
exampleId | ✅ | integer | As list_workshop_examples gives it |
title | string | Its title; a new one needs it | |
content | string | Its text (HTML), where the workshop takes online text; no aliases in it | |
attachments | string list | Absolute local paths: they replace the files attached before | |
embed | string list | Absolute local files to embed in the text, which names each by its file name: <img src="shot.png"> |
delete_workshop_example
Delete a workshop's example submission
Delete an example submission with its assessments (the reference one and participants' practice ones). Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
workshopId | ✅ | integer | The workshop's id (course module id) |
exampleId | ✅ | integer | As list_workshop_examples gives it |
assess_workshop_example
Assess a workshop's example submission
Assess an example submission through the workshop's assessment form, as assess_workshop_submission does a submission: a teacher's assessment is the reference participants' are compared with; a participant's is their practice, where the workshop lets them assess examples now. Returns the grade it gives.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
workshopId | ✅ | integer | The workshop's id (course module id) |
exampleId | ✅ | integer | As list_workshop_examples gives it |
criteria | object list | In the form's order | |
feedback | string | Overall feedback for the author (HTML); no aliases in it | |
fields | object | Any other field of the form, by name |
calculate_workshop_grades
Calculate a workshop's grades
Calculate a workshop's grades in the evaluation phase, as "Re-calculate grades" does: each submission's grade from its assessments, each assessment's grade for assessing by the workshop's evaluation method, comparison its strictness. Overridden grades stay. Returns the submissions and assessments with their grades (people as aliases when the server pseudonymizes). Students will see the grades once the workshop is closed: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
workshopId | ✅ | integer | The workshop's id (course module id) |
comparison | very strict, strict, fair, lax, very lax | How strictly assessments are compared with the best one; the form keeps the last one used |
override_workshop_grade
Override a workshop grade
Override a grade Moodle calculated in a workshop: a submission's grade, or an assessment's grade for assessing (give one of the two ids, from get_workshop), with feedback for the author or the reviewer; remove: true takes the override away, so the calculated grade counts again. Returns the submission or assessment afterwards. Students see it: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
workshopId | ✅ | integer | The workshop's id (course module id) |
submissionId | integer | ||
assessmentId | integer | ||
grade | integer | A whole number up to the workshop's grade for submission (or for assessment) | |
remove | boolean | Take the override away instead | |
feedback | string | HTML; no aliases in it |
get_workshop_allocation
Read who assesses whom in a workshop
Read a workshop's allocation as its manual allocation page shows it (in the course's current group): each submission with its author and the reviewers allocated to it, and the participants who may be allocated as reviewers. People as aliases when the server pseudonymizes. Takes a teacher's role.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
workshopId | ✅ | integer | The workshop's id (course module id) |
allocate_workshop_reviewer
Allocate a reviewer to a workshop submission
Allocate a reviewer to a submission, as the manual allocation page's "Add reviewer" does, in any phase. The submission by its id or its author, the reviewer one get_workshop_allocation lists as a potential reviewer (aliases when the server pseudonymizes). A reviewer already allocated is left as is. Returns the submission's reviewers afterwards. The reviewer is given work: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
workshopId | ✅ | integer | The workshop's id (course module id) |
submissionId | integer | The submission, as get_workshop_allocation gives it; or its author | |
author | string | The submission's author's alias, when the server pseudonymizes | |
authorId | integer | The submission's author's user id, when the server shows names | |
reviewer | string | The reviewer's alias, when the server pseudonymizes | |
reviewerId | integer | The reviewer's user id, when the server shows names |
remove_workshop_reviewer
Remove a reviewer from a workshop submission
Remove a reviewer's allocation to a submission: Moodle deletes their assessment of it. An assessment already graded is only deleted with evenIfAssessed, and its grade is lost. Returns the submission's reviewers afterwards. Confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
workshopId | ✅ | integer | The workshop's id (course module id) |
submissionId | integer | The submission, as get_workshop_allocation gives it; or its author | |
author | string | The submission's author's alias, when the server pseudonymizes | |
authorId | integer | The submission's author's user id, when the server shows names | |
reviewer | string | The reviewer's alias, when the server pseudonymizes | |
reviewerId | integer | The reviewer's user id, when the server shows names | |
evenIfAssessed | boolean | Also when they already assessed it (the assessment and its grade are deleted) |
allocate_workshop_randomly
Allocate a workshop's reviewers at random
Allocate submissions to reviewers at random, as the workshop's random allocation does: perSubmission reviews for each submission, or perReviewer for each reviewer; keeping the current allocations unless keepCurrent is false (graded ones are never removed), among reviewers with a submission unless withoutSubmission, with self-assessments if asked, without peers of the same group if asked. Returns how many were added and removed, Moodle's report and its problems (not enough reviewers…), and the allocation afterwards. Gives participants work: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
workshopId | ✅ | integer | The workshop's id (course module id) |
perSubmission | integer | Reviews each submission gets; or perReviewer | |
perReviewer | integer | Reviews each reviewer does | |
keepCurrent | boolean | Keep the allocations there are (default); false removes them first, never graded ones | |
withoutSubmission | boolean | Reviewers without a submission of their own too; off by default | |
selfAssessment | boolean | Add each author's self-assessment, where the workshop allows it | |
excludeSameGroup | boolean | No reviews by peers of the same group (visible groups mode only) |
schedule_workshop_allocation
Schedule a workshop's random allocation
Turn the workshop's scheduled allocation on or off: when on, Moodle allocates at random by itself at the end of the submission phase (once its submissions deadline passes), with the random allocation's settings given here (those left out keep what the form has). Returns the settings and Moodle's status of it (without a submissions deadline it never runs). Confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
workshopId | ✅ | integer | The workshop's id (course module id) |
enabled | ✅ | boolean | |
perSubmission | integer | Reviews each submission gets; or perReviewer | |
perReviewer | integer | Reviews each reviewer does | |
keepCurrent | boolean | Keep the allocations there are (default); false removes them first, never graded ones | |
withoutSubmission | boolean | Reviewers without a submission of their own too; off by default | |
selfAssessment | boolean | Add each author's self-assessment, where the workshop allows it | |
excludeSameGroup | boolean | No reviews by peers of the same group (visible groups mode only) |
list_notifications
List my notifications
List the person's notifications, newest first (only unread ones when asked), a page at a time: limit of them (30 by default) after skipping offset; more says whether there are others to ask for with a bigger offset. Each: subject, text, who it's from (an alias when the server pseudonymizes), when, whether it's read, and where it leads. Names in the texts are redacted when pseudonymizing.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
unreadOnly | boolean | ||
limit | integer | How many (30 by default) | |
offset | integer | How many to skip first, newest first (0 by default); with unreadOnly, it counts unread ones |
mark_notifications_read
Mark my notifications read
Mark all the person's notifications read, as the notifications popover's "Mark all as read" does. Doing it twice changes nothing.
No inputs.
list_conversations
List my conversations
List the person's message conversations, latest first: private, group or with themselves, their members (aliases when the server pseudonymizes), unread count and the last message as text. A page at a time: limit conversations (20 by default) after skipping offset; more says whether there are others. Read one with get_conversation.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
limit | integer | How many conversations (20 by default, up to 100) | |
offset | integer | How many conversations to skip first, latest first (0 by default) |
get_conversation
Read a conversation
Read a message conversation: its members and each message's sender (aliases when the server pseudonymizes), text and time; names and contact data in the texts are redacted when pseudonymizing. A page at a time, counted from the newest: limit messages (50 by default) after skipping offset, the first page the latest, each page's messages oldest first; more says whether there are older ones. Takes the id from list_conversations.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
conversationId | ✅ | integer | |
limit | integer | How many messages (50 by default, up to 200) | |
offset | integer | How many messages to skip first, counted from the newest (0 by default) |
send_message
Send a private message
Send a private message to someone, as the messaging drawer does: to user (an alias) when the server pseudonymizes, else userId. The text is plain; no aliases in it, since the recipient reads it. Returns the message and its conversation. Sent as the person, visibly: confirm the text and the recipient with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
user | string | The participant's alias, as the reading tools give it when the server pseudonymizes | |
userId | integer | The participant's user id, when the server shows names | |
text | ✅ | string |
message_participants
Message several participants
Send one private message to several participants of a course, as the participants page's "Send a message" does: to users (aliases) or userIds, or to everyone chosen by role, group or inactiveSince (everyone when none is given), the person left out. Returns who got it and who Moodle didn't write to, and why. The text is plain, with no aliases in it. Sent as the person, visibly: confirm the text and the recipients with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
text | ✅ | string | |
users | string list | The participants' aliases, as the reading tools give them when the server pseudonymizes | |
userIds | integer list | The participants' user ids, when the server shows names | |
role | integer | Or: everyone with this role | |
group | integer | Or: everyone in this group | |
inactiveSince | string | Or: everyone who hasn't accessed the course since this date (ISO 8601) |
Calendar and to-dos
| Tool | Description | Read only | Teacher | Student |
|---|---|---|---|---|
list_events | List upcoming calendar events | ✓ | ✓ | ✓ |
get_event | Read a calendar event | ✓ | ✓ | ✓ |
create_event | Create a course event | ✓ | ||
update_event | Change a calendar event | ✓ | ||
delete_event | Delete a calendar event | ✓ | ||
list_deadlines | List upcoming deadlines | ✓ | ✓ | ✓ |
list_pending | List what I have left | ✓ | ✓ | |
get_activities_overview | Get a course's activities overview | ✓ | ✓ | ✓ |
get_course_updates | Get what changed in a course | ✓ | ✓ | ✓ |
list_events
List upcoming calendar events
List the upcoming events of the person's calendar, as its "Upcoming events" view does, in one course or in all: course events, activities' dates and the person's own events.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | integer | Only this course's; every course when missing |
get_event
Read a calendar event
Read one calendar event by its id, as list_events gives them.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
eventId | ✅ | integer |
create_event
Create a course event
Create an event in a course's calendar, which its participants see: a name, a start (ISO 8601 with its time zone), and optionally a duration and a description (HTML). Returns the event. Visible to the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | |
name | ✅ | string | |
start | ✅ | string | ISO 8601, e.g. 2026-11-03T10:00:00+01:00 |
durationMinutes | integer | ||
description | string | HTML |
update_event
Change a calendar event
Change a calendar event through the calendar's own form: only what's given changes; a new start keeps its length unless a new one is given. Activities' dates are changed in the activity instead. Returns the event afterwards. Visible to the course: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
eventId | ✅ | integer | |
name | string | ||
description | string | HTML | |
start | string | ISO 8601 | |
durationMinutes | integer | ||
until | string | Or the end, ISO 8601 | |
location | string | ||
wholeSeries | boolean | For a repeated event: change every one |
delete_event
Delete a calendar event
Delete a calendar event the person can manage (a course event, or their own), by its id from list_events or create_event. Activities' dates are changed in the activity instead. Can't be undone: confirm with the person first. The server asks the person to confirm in their app first (MCP elicitation); declined, nothing happens.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
eventId | ✅ | integer |
list_deadlines
List upcoming deadlines
What the person has to do by a date, from Moodle's calendar (submit an assignment, attempt a quiz…), in one course or all of them: from a week ago (overdue ones) to some days ahead. Each with its activity id, date, whether it's overdue and the action Moodle offers. Teachers get few such events: for what's waiting to be graded, use get_activities_overview.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | integer | One course; every course when missing | |
days | integer | How many days ahead (default 30) |
list_pending
List what I have left
List what the logged-in person still has to do in a course: activities whose completion is tracked and not complete or, where completion isn't tracked, graded activities without a grade yet; with their dates, restrictions and whether they can be opened now. Takes the course id from list_courses.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | The course's id, as list_courses gives it |
get_activities_overview
Get a course's activities overview
Moodle's activities overview of a course, as the person sees it: per activity, its columns (due date, submissions, what needs grading, attempts, the person's own grade, forum subscriptions…), by type or for every type in the course. For a teacher, the quickest way to see what's waiting to be graded (alert "Needs grading"); for a student, what's due and their results. Moodle 5 and later.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | The course's id, from list_courses |
type | string | One activity type (assign, quiz, forum…; "resource" for every resource type); every type when missing |
get_course_updates
Get what changed in a course
What changed in a course's activities since a date (settings, content files, forum posts, submissions, attempts, grades…), as Moodle tracks it for the person, with each activity's name and type. Useful at the start of a session: what's new since last time.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | The course's id, from list_courses |
since | string | ISO date and time; a week ago when missing |
As a student
| Tool | Description | Read only | Teacher | Student |
|---|---|---|---|---|
get_my_grades | Get my grades | ✓ | ✓ | |
get_assignment | Get an assignment as a student | ✓ | ✓ | |
save_submission | Save my submission | ✓ | ||
submit_assignment | Submit my assignment for grading | ✓ | ||
get_quiz_info | Get a quiz's information and my attempts | ✓ | ✓ | ✓ |
start_quiz_attempt | Start or continue a quiz attempt | ✓ | ||
get_quiz_attempt | Read an attempt's questions | ✓ | ✓ | |
answer_quiz_questions | Answer quiz questions | ✓ | ||
finish_quiz_attempt | Submit a quiz attempt | ✓ | ||
get_attempt_review | Review a finished attempt | ✓ | ✓ | ✓ |
get_survey | Get a survey's questions | ✓ | ✓ | |
submit_survey | Answer and submit a survey | ✓ | ||
get_choice | Read a choice | ✓ | ✓ | ✓ |
answer_choice | Answer a choice | ✓ | ||
get_lesson_page | Read the current lesson page | ✓ | ||
answer_lesson_page | Answer a lesson page | ✓ | ||
get_h5p_activity | Read an H5P activity | ✓ | ✓ | ✓ |
get_scorm | Read a SCORM activity | ✓ | ✓ | ✓ |
open_scorm | Open a SCORM package to do it | ✓ | ||
set_completion | Mark an activity as done | ✓ |
get_my_grades
Get my grades
Get the logged-in person's grade report for a course: each grade item (with its activity id), category and the course total, with grade, range, percentage, weight, letter, feedback and contribution, as Moodle shows them. Takes the course id from list_courses.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
courseId | ✅ | integer | The course's id, as list_courses gives it |
get_assignment
Get an assignment as a student
Read an assignment as the logged-in student sees it: the brief and its files, dates, the submission's status and content, grade and feedback, and whether it can be edited or submitted now.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
assignmentId | ✅ | integer | The assignment's id (course module id), as get_course_structure gives it |
save_submission
Save my submission
Save the logged-in student's submission to an assignment: its online text (HTML, replacing what was there) and files to add (absolute local paths). Doesn't submit it for grading when the assignment asks students to click submit: submit_assignment does. Returns the assignment as the student sees it. Changes the submission: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
assignmentId | ✅ | integer | The assignment's id (course module id), as get_course_structure gives it |
onlineText | string | ||
files | string list |
submit_assignment
Submit my assignment for grading
Submit the saved submission for grading: it can't be changed afterwards unless the teacher reopens it. When the site asks to accept a statement (it's your own work…), the call fails quoting it until acceptStatement is true. Final: confirm with the person first, after checking the submission with get_assignment.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
assignmentId | ✅ | integer | The assignment's id (course module id), as get_course_structure gives it |
acceptStatement | boolean | The person accepts the site's submission statement |
get_quiz_info
Get a quiz's information and my attempts
Read a quiz's page as the person: description, its rules (attempts allowed, grading method, time limit…), dates, overall feedback, the person's attempts (with their ids, in progress or finished, and grades) and whether they can start one now.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
quizId | ✅ | integer | The quiz's id (course module id), as get_course_structure gives it |
start_quiz_attempt
Start or continue a quiz attempt
Start an attempt at a quiz, or continue the one in progress, as the quiz page's button does; returns the attempt's id and its questions with their fields and options. Starting uses up one of the attempts allowed, and a time limit starts running: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
quizId | ✅ | integer | The quiz's id (course module id), as get_course_structure gives it |
get_quiz_attempt
Read an attempt's questions
Read every question of an attempt in progress, page by page: text, images, fields with their options, and the answers saved so far.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
attemptId | ✅ | integer | The attempt's id, as start_quiz_attempt or get_quiz_info gives it |
answer_quiz_questions
Answer quiz questions
Save answers in an attempt in progress, as the attempt's pages do; it doesn't finish the attempt. Each answer names a question's slot and its fields by name with the value to give: an option's value for choice and select fields, "1" or "0" for checkboxes, text for text fields. Returns the questions with their saved answers. With the realistic trail it pauses to read each page first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
attemptId | ✅ | integer | The attempt's id, as start_quiz_attempt or get_quiz_info gives it |
answers | ✅ | object list |
finish_quiz_attempt
Submit a quiz attempt
Submit an attempt for grading, as "Submit all and finish" does: no answer can change afterwards. Returns the review when the quiz shows it. Final: confirm with the person first, after checking the answers with get_quiz_attempt.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
attemptId | ✅ | integer | The attempt's id, as start_quiz_attempt or get_quiz_info gives it |
get_attempt_review
Review a finished attempt
Read a finished attempt's review, as far as the quiz shows it: status, marks and grade, and per question whether it was right, the mark, feedback and the right answer. Someone else's attempt (a teacher's view) names them by alias, and their written answers are redacted, when the server pseudonymizes.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
attemptId | ✅ | integer | The attempt's id, as start_quiz_attempt or get_quiz_info gives it |
get_survey
Get a survey's questions
Read a survey (the questionnaire plugin, or Moodle's feedback) as the person: whether they can answer it now, its messages (completed, closed…), and every question on every page, with whether it's required and its fields (names, options).
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The survey's id (course module id), as get_course_structure gives it |
type | ✅ | questionnaire, feedback | The activity's type, as get_course_structure gives it |
submit_survey
Answer and submit a survey
Answer a survey and submit it, page by page as its form goes: responses maps field names (from get_survey) to values ("1"/"0" for checkboxes, an option's value for choices and selects, text otherwise). Every name is checked first; Moodle's complaints (a required question left out) come back by page. Usually one response per person: confirm the answers with the person first, and ask them for personal data instead of guessing.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The survey's id (course module id), as get_course_structure gives it |
type | ✅ | questionnaire, feedback | The activity's type, as get_course_structure gives it |
responses | ✅ | object |
get_choice
Read a choice
Read a choice activity (a poll) as the person sees it: its question, the options with their ids, whether it's open, whether several can be chosen and whether the answer can change, and the person's answer.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The activity's id (course module id), as get_course_structure gives it |
answer_choice
Answer a choice
Answer a choice activity as the person, with one option (several where the choice allows them) by id from get_choice, as "Save my choice" does. Returns the choice afterwards. Answers as the person, and some choices don't allow changing it: confirm with the person first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The activity's id (course module id), as get_course_structure gives it |
optionIds | ✅ | integer list |
get_lesson_page
Read the current lesson page
Read the page of a lesson the person is on (starting the lesson the first time): a content page with its buttons, a question with its fields, or the end with the score. Answer it with answer_lesson_page.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The activity's id (course module id), as get_course_structure gives it |
answer_lesson_page
Answer a lesson page
Go on in a lesson as the person: press a content page's button (by its label, or by its position from 1), or answer a question page's fields by name (an option's value for choice and select, text for text). Returns Moodle's feedback, if any, and the next page; reaching the end ends the attempt. Answers count towards the lesson's grade and can't be taken back. With the realistic trail it pauses to read the page first.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The activity's id (course module id), as get_course_structure gives it |
button | string | A content page's button, by its label | |
buttonPosition | integer | Or by its position, from 1 | |
responses | object | A question page's answers: field name → value, as get_lesson_page gives the fields |
get_h5p_activity
Read an H5P activity
Read an H5P activity: its content type (the H5P library), whether Moodle tracks attempts, and the person's own attempts with their scores. Solving the content itself (it runs in a player) is for the browser fallback tools.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The activity's id (course module id), as get_course_structure gives it |
get_scorm
Read a SCORM activity
Read a SCORM activity as the person sees it: attempts allowed and made, grading method, the grade reported and each attempt's, and its SCOs (the package's parts) with the person's status and score in the last attempt. Use it before open_scorm, and after doing the package to see what Moodle recorded.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The SCORM activity's id (course module id), as get_course_structure gives it |
open_scorm
Open a SCORM package to do it
Open a SCORM activity in Moodle's player, as the person, in the browser tools' tab: the last attempt continues unless newAttempt, at the first SCO unless scoId. Opening it starts an attempt in Moodle. Then do the package with the browser tools: browser_snapshot reads it (refs inside its frame start with f, like f2e9), browser_click, browser_type and browser_select act on them, browser_wait waits for its texts. Afterwards, check the result with get_scorm instead of assuming it. Nothing marks a SCORM done or graded but doing it.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The SCORM activity's id (course module id), as get_course_structure gives it |
scoId | integer | The SCO to open, as get_scorm gives it; the first when missing | |
newAttempt | boolean | Start a new attempt instead of continuing the last one |
set_completion
Mark an activity as done
Mark the person's own completion of an activity with manual completion, done or not done, as its "Mark as done" button does. Activities that complete on their own (by viewing, grade, submission) can't be marked: Moodle says so. Doing it twice changes nothing.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
activityId | ✅ | integer | The activity's id (course module id), as get_course_structure gives it |
done | ✅ | boolean |
Browser
These are for what no other tool covers: a plugin, a rare setting, the inside of a SCORM package. The agent uses them on your site only, never types passwords, and says which task needed them. With pseudonymize, they never open pages about people (participants, grades, reports, forums, messages).
| Tool | Description | Read only | Teacher | Student |
|---|---|---|---|---|
browser_navigate | Browser: open a page | ✓ | ✓ | |
browser_snapshot | Browser: read the page | ✓ | ✓ | ✓ |
browser_click | Browser: click | ✓ | ✓ | |
browser_type | Browser: type | ✓ | ✓ | |
browser_select | Browser: choose options | ✓ | ✓ | |
browser_upload | Browser: choose files | ✓ | ✓ | |
browser_screenshot | Browser: screenshot | ✓ | ✓ | ✓ |
browser_wait | Browser: wait | ✓ | ✓ | ✓ |
browser_navigate
Browser: open a page
Open a page of the configured Moodle site in the browser tools' tab: a URL of the site, or a path relative to it. Other sites are refused. A fallback: use it only when no Moodle tool covers the task, and say which task, so a tool can be made for it. Works in one tab of the server's session (the one show_browser displays; Moodle tools may move it while the browser is shown).
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
url | ✅ | string | A URL of the site, or a path relative to it (course/view.php?id=3) |
browser_snapshot
Browser: read the page
The page in the browser tools' tab as an accessibility tree (roles, names, values), with a ref per element ([ref=e12]) for the other browser tools. By default the main region only (#region-main, where Moodle puts the content), or the whole page, or one element's subtree by ref. Cut at 30000 characters: snapshot a narrower part when cut. A fallback: use it only when no Moodle tool covers the task, and say which task, so a tool can be made for it.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
scope | main, page | "main" (default): Moodle's main region; "page": everything, navigation included | |
ref | string | Only this element's subtree (from a previous snapshot) |
browser_click
Browser: click
Click an element of the browser tools' tab by its snapshot ref (a link, button, checkbox, tab…), and wait for the page it leads to. Links to other sites are blocked. A click can change the site (save, delete, submit): confirm with the person first, as with any Moodle change. A fallback: use it only when no Moodle tool covers the task, and say which task, so a tool can be made for it.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
ref | ✅ | string | The element's ref from the latest browser_snapshot, like e12 |
doubleClick | boolean |
browser_type
Browser: type
Fill a text field of the browser tools' tab by its snapshot ref, replacing what it holds; optionally press Enter after. Password fields are refused: the person logs in themselves (login). A fallback: use it only when no Moodle tool covers the task, and say which task, so a tool can be made for it.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
ref | ✅ | string | The element's ref from the latest browser_snapshot, like e12 |
text | ✅ | string | |
submit | boolean | Press Enter after typing |
browser_select
Browser: choose options
Choose options in a select of the browser tools' tab by its snapshot ref, by their values or visible labels (several for a multiple select). A fallback: use it only when no Moodle tool covers the task, and say which task, so a tool can be made for it.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
ref | ✅ | string | The element's ref from the latest browser_snapshot, like e12 |
options | ✅ | string list |
browser_upload
Browser: choose files
Set local files on a file input of the browser tools' tab by its snapshot ref (in Moodle's file picker, the "Upload a file" input), as if the person had chosen them. Absolute paths. A fallback: use it only when no Moodle tool covers the task, and say which task, so a tool can be made for it.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
ref | ✅ | string | The element's ref from the latest browser_snapshot, like e12 |
paths | ✅ | string list | Absolute paths of local files |
browser_screenshot
Browser: screenshot
Only with MOODLE_MCP_STUDENT_DATA=clear: what it returns can't be pseudonymized. See Students' privacy.
A picture of the browser tools' tab (what's in view), or of one element by its snapshot ref. For what the accessibility tree can't tell (layout, images, a canvas); read text with browser_snapshot instead. A fallback: use it only when no Moodle tool covers the task, and say which task, so a tool can be made for it.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
ref | string | The element's ref from the latest browser_snapshot, like e12 |
browser_wait
Browser: wait
Wait in the browser tools' tab until a text shows, until it's gone (in the page or any frame in it, such as a SCORM package's), or for some seconds (at most 30): for pages that load or change on their own. A fallback: use it only when no Moodle tool covers the task, and say which task, so a tool can be made for it.
Inputs
| Input | Required | Type | Description |
|---|---|---|---|
text | string | Wait until this text shows | |
textGone | string | Wait until this text is gone | |
seconds | number | Wait this long (with a text: the most to wait; default 10) |