Skip to main content
Version: 0.5.0

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​

ToolDescriptionRead onlyTeacherStudent
loginLog in to Moodle✓✓✓
logoutLog out of Moodle✓✓✓
get_meWho am I✓✓✓
get_site_infoGet the Moodle site's info✓✓✓
configureConfigure the server✓✓✓
show_browserShow or hide the browser✓✓✓
server_infoServer info✓✓✓
list_sitesList the Moodle sites✓✓✓
add_siteAdd a Moodle site✓✓✓
use_siteSwitch to another Moodle site✓✓✓
remove_siteRemove 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
InputRequiredTypeDescription
timeoutSecondsintegerHow 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
InputRequiredTypeDescription
courseIdintegerA 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
InputRequiredTypeDescription
courseIdintegerA 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
InputRequiredTypeDescription
urlstringThe Moodle site's URL, or any page of it (a course URL works: the site is read from it)
headlessbooleanRun the browser without a window (logging in always shows one)
trailrealistic, fastHow student tools view and do things: realistic (real pages, human pace; Moodle logs views and completion) or fast
profileDirstringAbsolute folder for the browser profile that keeps the Moodle session; outside the server's folder
scopesstringNarrow 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
studentDatablock, pseudonymize, clearTighten how others' data reaches you for this session (block is strictest). Only stricter than now, never looser
roleall, teacher, studentKeep only one role's tools for this session (teacher or student), from all; never back to all
accessread, writeread: keep only the tools that change nothing in Moodle for this session; never back to write
coursesstring listKeep 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
InputRequiredTypeDescription
visible✅booleantrue 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
InputRequiredTypeDescription
urlstringThe site's URL, or any page of it; without it, the person is asked in their app when it can
namestringA 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
InputRequiredTypeDescription
name✅stringThe 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
InputRequiredTypeDescription
name✅stringThe site's name, as list_sites gives it

Courses and content​

ToolDescriptionRead onlyTeacherStudent
list_coursesList my courses✓✓✓
get_course_structureGet a course's structure✓✓✓
get_activity_contentRead an activity's content✓✓✓
get_activity_settingsGet an activity's settings✓✓
download_fileDownload a file from Moodle✓✓✓
create_activityCreate an activity or resource✓
update_activityUpdate an activity's settings or content✓
validate_htmlCheck HTML before sending it to Moodle✓✓✓
edit_activityMove, rename, show or hide an activity✓
duplicate_activityDuplicate an activity✓
delete_activityDelete an activity✓
add_sectionAdd a section✓
edit_sectionEdit a section✓
delete_sectionDelete a section✓
update_courseUpdate 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
InputRequiredTypeDescription
classificationall, inprogress, future, pastWhich 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
InputRequiredTypeDescription
courseId✅integerThe course's id, as list_courses gives it
detailsbooleanAlso 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
InputRequiredTypeDescription
activityId✅integerThe activity's id (course module id), as get_course_structure gives it
type✅page, book, label, url, resource, folderThe 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
InputRequiredTypeDescription
activityId✅integerThe 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
InputRequiredTypeDescription
url✅stringThe file's URL on the site, as the other tools give it (…/pluginfile.php/…)
destDir✅stringAbsolute 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, or a SCORM's package (type scorm, the first file). Returns the new activity's id and the course structure. Changes the course: confirm with the person first.

Inputs
InputRequiredTypeDescription
courseId✅integer
sectionId✅integerThe section's id, as get_course_structure gives it
type✅stringMoodle's module name: page, label, url, resource, folder, assign, quiz, forum, book…
namestringRequired except for labels
filesstring listAbsolute local paths: a file resource's file (the first is the main one), a folder's files, a SCORM's package (.zip)
toolIdintegertype lti: the external tool it's made from, as list_external_tools gives it (Moodle 5 makes LTI activities only from a tool)
descriptionstringThe description (HTML), shown on the activity's page
contentstringA page's content, or a label's text (HTML)
urlstringA URL resource's target
visibilityshown, hidden, stealth"stealth": hidden from the course page but available by link, where the site allows it
restrictionsobjectWhen students can open it ({ conditions: [] } removes them)
completionobjectWhen it counts as complete
embedstring listAbsolute local files (images…) to embed in the HTML, which names each by its file name: <img src="shot.png">
settingsobjectAny 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
InputRequiredTypeDescription
activityId✅integerThe activity's id (course module id), as get_course_structure gives it
namestring
descriptionstringThe description (HTML), shown on the activity's page
contentstringA page's content, or a label's text (HTML)
urlstringA URL resource's target
visibilityshown, hidden, stealth"stealth": hidden from the course page but available by link, where the site allows it
restrictionsobjectWhen students can open it ({ conditions: [] } removes them)
completionobjectWhen it counts as complete
embedstring listAbsolute local files (images…) to embed in the HTML, which names each by its file name: <img src="shot.png">
settingsobjectAny other form field by its name in Moodle's activity form, e.g. {"duedate[enabled]": true, "duedate[day]": 12, "grade[modgrade_point]": 10}
filesobjectA file resource's or folder's files; untouched when missing
packagestringA 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
InputRequiredTypeDescription
textstringThe HTML
filestringOr an absolute path to a local HTML file
embedstring listThe 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
InputRequiredTypeDescription
courseId✅integerThe course's id, as list_courses gives it
activityId✅integerThe activity's id (course module id), as get_course_structure gives it
namestring
visibilityshown, hidden, stealth
sectionIdintegerMove it to the end of this section
beforeActivityIdintegerMove 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
InputRequiredTypeDescription
courseId✅integerThe course's id, as list_courses gives it
activityId✅integerThe 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
InputRequiredTypeDescription
courseId✅integerThe course's id, as list_courses gives it
activityId✅integerThe 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
InputRequiredTypeDescription
courseId✅integerThe course's id, as list_courses gives it
namestring
summarystringIts description (HTML)
embedstring listAbsolute local files (images…) to embed in the HTML, which names each by its file name: <img src="shot.png">
afterSectionIdintegerAdd 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
InputRequiredTypeDescription
courseId✅integerThe course's id, as list_courses gives it
sectionId✅integerA section's id (not its number), as get_course_structure gives it
namestring
visibleboolean
summarystringIts description (HTML)
embedstring listAbsolute local files (images…) to embed in the HTML, which names each by its file name: <img src="shot.png">
restrictionsobjectWhen students can open it ({ conditions: [] } removes them)
afterSectionIdintegerMove 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
InputRequiredTypeDescription
courseId✅integerThe course's id, as list_courses gives it
sectionId✅integerA 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
InputRequiredTypeDescription
courseId✅integer
fullNamestring
shortNamestring
summarystringHTML
embedstring listAbsolute local files (images…) to embed in the HTML, which names each by its file name: <img src="shot.png">
settingsobjectOther fields by their name in the course settings form, e.g. {"visible": 0, "startdate[day]": 1}

Books, lessons, wikis, glossaries, databases and feedback​

ToolDescriptionRead onlyTeacherStudent
list_book_chaptersList a book's chapters✓✓
add_book_chapterAdd a chapter to a book✓
edit_book_chapterChange a book's chapter✓
move_book_chapterMove a book's chapter up or down✓
set_book_chapter_visibilityShow or hide a book's chapter✓
delete_book_chapterDelete a book's chapter✓
get_lesson_pagesRead a lesson's pages as its teacher✓✓
add_lesson_pageAdd a page to a lesson✓
edit_lesson_pageChange a lesson's page✓
move_lesson_pageMove a lesson's page✓
delete_lesson_pageDelete a lesson's page✓
get_database_fieldsRead a database's fields✓✓
add_database_fieldAdd a field to a database✓
edit_database_fieldChange a database's field✓
delete_database_fieldDelete a database's field✓
get_database_templatesRead a database's templates✓✓
set_database_templateSet a database's template✓
list_database_presetsList the presets for a database✓✓
apply_database_presetGive a database a preset✓
list_database_entriesRead a database's entries✓✓✓
add_database_entryAdd an entry to a database✓✓
edit_database_entryChange a database entry✓✓
delete_database_entryDelete a database entry✓✓
set_database_entry_approvedApprove a database entry✓
export_database_entriesExport a database's entries to CSV✓✓
import_database_entriesImport entries into a database from CSV✓
list_glossary_entriesRead a glossary's entries✓✓✓
add_glossary_entryAdd an entry to a glossary✓✓
edit_glossary_entryChange a glossary entry✓✓
delete_glossary_entryDelete a glossary entry✓✓
set_glossary_entry_approvedApprove a glossary entry✓
list_glossary_categoriesList a glossary's categories✓✓✓
add_glossary_categoryAdd a category to a glossary✓
export_glossaryExport a glossary's entries to a file✓✓
import_glossaryImport entries into a glossary✓
list_wiki_pagesList a wiki's pages✓✓✓
get_wiki_pageRead a wiki page✓✓✓
create_wiki_pageCreate a wiki page✓✓
edit_wiki_pageEdit a wiki page✓✓
get_feedback_itemsRead a feedback's questions✓✓
add_feedback_itemAdd a question to a feedback✓
edit_feedback_itemChange a feedback's question✓
move_feedback_itemMove a feedback's question✓
delete_feedback_itemDelete a feedback's question✓
list_feedback_templatesList feedback templates✓✓
use_feedback_templateUse a template in a feedback✓
save_feedback_templateSave a feedback as a template✓
delete_feedback_templateDelete 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
InputRequiredTypeDescription
bookId✅integerThe book's id (course module id), as get_course_structure gives it
contentbooleanAlso 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
InputRequiredTypeDescription
bookId✅integerThe book's id (course module id), as get_course_structure gives it
title✅string
content✅stringIts content (HTML); Moodle requires some
subchapterbooleanA subchapter of the chapter before it (not for the first)
hiddenbooleanHidden from students
afterChapterIdintegerThe chapter it goes after; at the end without it
embedstring listAbsolute 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
InputRequiredTypeDescription
bookId✅integerThe book's id (course module id), as get_course_structure gives it
chapterId✅integerThe chapter's id, as list_book_chapters gives it
titlestring
contentstring
subchapterboolean
embedstring listAbsolute 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
InputRequiredTypeDescription
bookId✅integerThe book's id (course module id), as get_course_structure gives it
chapterId✅integerThe 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
InputRequiredTypeDescription
bookId✅integerThe book's id (course module id), as get_course_structure gives it
chapterId✅integerThe 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
InputRequiredTypeDescription
bookId✅integerThe book's id (course module id), as get_course_structure gives it
chapterId✅integerThe 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
InputRequiredTypeDescription
lessonId✅integerThe 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
InputRequiredTypeDescription
lessonId✅integerThe 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
titlestring
contentsstringThe page's contents (HTML); local files it names (<img src="shot.png">) go in embed
embedstring listAbsolute local files to embed in the contents, answers or responses
buttonsobject listA content page's buttons, in order; given, they replace them all
answersobject listA question page's answers, in order (given, they replace them all); an essay or structural page's single row
multipleAnswersbooleanMultichoice: more than one answer can be right
caseSensitivebooleanShort answer: answers compared case-sensitively
fieldsobjectAny other field of the page's form, by name (layout, display…)
afterintegerThe 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
InputRequiredTypeDescription
lessonId✅integerThe lesson's id (course module id), as get_course_structure gives it
pageId✅integerThe page's id, as get_lesson_pages gives it
titlestring
contentsstringThe page's contents (HTML); local files it names (<img src="shot.png">) go in embed
embedstring listAbsolute local files to embed in the contents, answers or responses
buttonsobject listA content page's buttons, in order; given, they replace them all
answersobject listA question page's answers, in order (given, they replace them all); an essay or structural page's single row
multipleAnswersbooleanMultichoice: more than one answer can be right
caseSensitivebooleanShort answer: answers compared case-sensitively
fieldsobjectAny 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
InputRequiredTypeDescription
lessonId✅integerThe lesson's id (course module id), as get_course_structure gives it
pageId✅integerThe page's id, as get_lesson_pages gives it
after✅integerThe 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
InputRequiredTypeDescription
lessonId✅integerThe lesson's id (course module id), as get_course_structure gives it
pageId✅integerThe 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
InputRequiredTypeDescription
databaseId✅integerThe 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
InputRequiredTypeDescription
databaseId✅integerThe 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
descriptionstring
requiredboolean
optionsobjectThe 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
InputRequiredTypeDescription
databaseId✅integerThe database's id (course module id), as get_course_structure gives it
fieldId✅integerThe field's id, as get_database_fields gives it
namestring
descriptionstring
requiredboolean
optionsobjectThe 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
InputRequiredTypeDescription
databaseId✅integerThe database's id (course module id), as get_course_structure gives it
fieldId✅integerThe 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
InputRequiredTypeDescription
databaseId✅integerThe 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
InputRequiredTypeDescription
databaseId✅integerThe database's id (course module id), as get_course_structure gives it
template✅list, listHeader, listFooter, single, add, search, rss, rssTitle, css, js
htmlstringThe template (HTML, or CSS or JavaScript)
resetbooleanMoodle'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
InputRequiredTypeDescription
databaseId✅integerThe 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
InputRequiredTypeDescription
databaseId✅integerThe database's id (course module id), as get_course_structure gives it
presetId✅stringAs 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
InputRequiredTypeDescription
databaseId✅integerThe database's id (course module id), as get_course_structure gives it
searchstring
limitintegerHow many entries (25 by default, up to 100)
offsetintegerHow 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
InputRequiredTypeDescription
databaseId✅integerThe database's id (course module id), as get_course_structure gives it
values✅objectBy 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
InputRequiredTypeDescription
databaseId✅integerThe database's id (course module id), as get_course_structure gives it
entryId✅integerThe entry's id, as list_database_entries gives it
valuesobjectBy 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.
removeFilesstring listFile 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
InputRequiredTypeDescription
databaseId✅integerThe database's id (course module id), as get_course_structure gives it
entryId✅integerThe 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
InputRequiredTypeDescription
databaseId✅integerThe database's id (course module id), as get_course_structure gives it
entryId✅integerThe 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
InputRequiredTypeDescription
databaseId✅integerThe database's id (course module id), as get_course_structure gives it
file✅stringAn absolute local path for the CSV (replaced if it's there)
userDetailsbooleanThe authors' full name, username and email
timesboolean
approvalboolean

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
InputRequiredTypeDescription
databaseId✅integerThe database's id (course module id), as get_course_structure gives it
file✅stringAn absolute local path to the CSV
delimitercomma, 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
InputRequiredTypeDescription
glossaryId✅integerThe glossary's id (course module id), as get_course_structure gives it
letterstringOnly concepts starting with this letter
searchstringWords in concepts, aliases or definitions
pendingbooleanThe entries waiting for approval instead (a teacher's)
limitintegerHow many entries (30 by default, up to 200)
offsetintegerHow 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
InputRequiredTypeDescription
glossaryId✅integerThe glossary's id (course module id), as get_course_structure gives it
concept✅string
definition✅stringHTML; no aliases in it
aliasesstring listOther words it's found and linked by
categoryIdsinteger listAs list_glossary_categories gives them
attachmentsstring listAbsolute local paths of files to attach
embedstring listAbsolute 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
InputRequiredTypeDescription
glossaryId✅integerThe glossary's id (course module id), as get_course_structure gives it
entryId✅integerThe entry's id, as list_glossary_entries gives it
conceptstring
definitionstringHTML; no aliases in it
aliasesstring listOther words it's found and linked by
categoryIdsinteger listAs list_glossary_categories gives them
attachmentsstring listAbsolute local paths of files to attach
embedstring listAbsolute 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
InputRequiredTypeDescription
glossaryId✅integerThe glossary's id (course module id), as get_course_structure gives it
entryId✅integerThe 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
InputRequiredTypeDescription
glossaryId✅integerThe glossary's id (course module id), as get_course_structure gives it
entryId✅integerThe 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
InputRequiredTypeDescription
glossaryId✅integerThe 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
InputRequiredTypeDescription
glossaryId✅integerThe glossary's id (course module id), as get_course_structure gives it
name✅string
autoLinkboolean

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
InputRequiredTypeDescription
glossaryId✅integerThe glossary's id (course module id), as get_course_structure gives it
destDir✅stringAn 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
InputRequiredTypeDescription
glossaryId✅integerThe glossary's id (course module id), as get_course_structure gives it
file✅stringAn absolute local path to the XML file
categoriesbooleanBring 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
InputRequiredTypeDescription
wikiId✅integerThe wiki's id (course module id), as get_course_structure gives it
groupIdintegerA group's subwiki, in a wiki with groups; the person's own when missing
participantstringA participant's subwiki in an individual wiki, by alias when the server pseudonymizes
participantIdintegerOr by user id, when the server shows names
limitintegerHow many pages (50 by default, up to 200)
offsetintegerHow 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
InputRequiredTypeDescription
wikiId✅integerThe wiki's id (course module id), as get_course_structure gives it
pageId✅integerThe page's id, as list_wiki_pages gives it
historybooleanEvery 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
InputRequiredTypeDescription
wikiId✅integerThe wiki's id (course module id), as get_course_structure gives it
title✅string
content✅stringNo aliases in it
embedstring listAbsolute local files to embed in the content (HTML pages), which names each by its file name: <img src="shot.png">
groupIdintegerA group's subwiki, in a wiki with groups; the person's own when missing
participantstringA participant's subwiki in an individual wiki, by alias when the server pseudonymizes
participantIdintegerOr 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
InputRequiredTypeDescription
wikiId✅integerThe wiki's id (course module id), as get_course_structure gives it
pageId✅integerThe page's id, as list_wiki_pages gives it
content✅stringReplaces the page's, or the section's; no aliases in it
sectionstring
embedstring listAbsolute 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
InputRequiredTypeDescription
feedbackId✅integerThe 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
InputRequiredTypeDescription
feedbackId✅integerThe feedback's id (course module id), as get_course_structure gives it
type✅multichoice, multichoicerated, textfield, textarea, numeric, info, label, captcha, pagebreak
questionstringEvery type but a label and a page break needs one
labelstring
requiredboolean
optionsobject listChoice items' options, in order; given, they replace them all
displayradio, checkbox, dropdowncheckbox (several answers) for multichoice only
horizontalboolean
hideNotSelectedboolean
ignoreEmptyboolean
rangeobjectA numeric item's; a bound left out is none
inforesponse-time, course, category
contentsstringA label's (HTML)
dependsOnobjectShow it only when another item was answered with this value: an item with a label, on an earlier page (a page break between them)
fieldsobjectAny other field of the item's form, by name (itemsize, itemmaxlength…)
afterintegerThe 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
InputRequiredTypeDescription
feedbackId✅integerThe feedback's id (course module id), as get_course_structure gives it
itemId✅integerThe item's id, as get_feedback_items gives it
questionstringEvery type but a label and a page break needs one
labelstring
requiredboolean
optionsobject listChoice items' options, in order; given, they replace them all
displayradio, checkbox, dropdowncheckbox (several answers) for multichoice only
horizontalboolean
hideNotSelectedboolean
ignoreEmptyboolean
rangeobjectA numeric item's; a bound left out is none
inforesponse-time, course, category
contentsstringA label's (HTML)
dependsOnobjectShow it only when another item was answered with this value: an item with a label, on an earlier page (a page break between them)
fieldsobjectAny other field of the item's form, by name (itemsize, itemmaxlength…)
removeDependencyboolean

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
InputRequiredTypeDescription
feedbackId✅integerThe feedback's id (course module id), as get_course_structure gives it
itemId✅integerThe 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
InputRequiredTypeDescription
feedbackId✅integerThe feedback's id (course module id), as get_course_structure gives it
itemId✅integerThe 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
InputRequiredTypeDescription
feedbackId✅integerThe 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
InputRequiredTypeDescription
feedbackId✅integerThe feedback's id (course module id), as get_course_structure gives it
templateId✅integerAs list_feedback_templates gives it
replaceboolean

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
InputRequiredTypeDescription
feedbackId✅integerThe feedback's id (course module id), as get_course_structure gives it
name✅string
publicboolean

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
InputRequiredTypeDescription
feedbackId✅integerThe feedback's id (course module id), as get_course_structure gives it
templateId✅integerAs list_feedback_templates gives it

Course life cycle​

ToolDescriptionRead onlyTeacherStudent
copy_courseCopy a course✓
backup_courseBack up a course✓
restore_courseRestore a course backup✓
read_backupRead what a backup file holds✓✓
anonymize_backupAnonymize a backup file✓✓
import_activitiesImport activities from another course✓
reset_courseReset a course for a new year✓
copy_between_sitesCopy 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
InputRequiredTypeDescription
courseId✅integer
fullName✅string
shortName✅string
categoryIdinteger
startstringThe new course's start, ISO 8601
endstringThe new course's end, ISO 8601
withUsersbooleanAlso its participants and their data (default false)
visibleboolean

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
InputRequiredTypeDescription
courseId✅integer
destDir✅stringAn absolute local folder for the file
withUsersbooleanAlso its participants' data (default false)
anonymizebooleanWith users: Moodle makes their names and contact data anonymous
sectionsinteger listOnly these sections, by id (get_course_structure), each with everything in it
activitiesinteger listOnly these activities and resources, by course module id
anonymousbooleanThe 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
InputRequiredTypeDescription
file✅stringThe backup's absolute local path (.mbz)
intoCourseIdintegerAn existing course to restore into; a new course when missing
categoryIdintegerFor a new course: its category
modemerge, replaceInto an existing course: add to it (default) or replace its content
fullNamestring
shortNamestring
withUsersbooleanRestore the participants' data the backup has (default false)
sectionIdintegerMerged into a course: every restored activity at the end of this section
afterSectionIdintegerMerged 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
InputRequiredTypeDescription
file✅stringAn 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
InputRequiredTypeDescription
file✅stringAn absolute local path to the .mbz file
destFile✅stringWhere 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
InputRequiredTypeDescription
fromCourseId✅integer
toCourseId✅integer
activityIdsinteger listOnly 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
InputRequiredTypeDescription
courseId✅integer
deleteobject
unenrolRolesinteger listRole ids whose people are unenrolled
startstringThe new start date, ISO 8601
fieldsobjectAny 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
InputRequiredTypeDescription
fromSite✅stringA site's name, as list_sites gives it
courseId✅integerThe course to copy from, on fromSite
activityIdsinteger listOnly these activities and resources, by course module id
sectionIdsinteger listOnly these sections, by id, each with everything in it
toSite✅stringA site's name, as list_sites gives it
toCourseIdintegerAn existing course on toSite to copy into
toSectionIdintegerInto toCourseId: every copied activity at the end of this section
toAfterSectionIdintegerInto toCourseId: copied sections as new sections after this one
toCategoryIdintegerA whole course only: a new course in this category on toSite, instead of toCourseId

Assignments and grading​

ToolDescriptionRead onlyTeacherStudent
list_assignmentsList a course's assignments✓✓✓
get_submissionsGet an assignment's submissions✓✓
get_rubricGet an assignment's grading criteria✓✓
set_rubricDefine an assignment's rubric or marking guide✓
grade_submissionGrade a submission✓
grant_extensionGrant an assignment extension✓
set_workflow_stateSet the marking workflow state✓
allocate_markerAllocate 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
InputRequiredTypeDescription
courseId✅integerThe 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
InputRequiredTypeDescription
assignmentId✅integerThe assignment's id (its course module id), as list_assignments gives it
includeContentbooleanInclude each submission's content: online text and file links (default true)
limitintegerHow many participants (25 by default, up to 200)
offsetintegerHow 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
InputRequiredTypeDescription
assignmentId✅integerThe 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
InputRequiredTypeDescription
assignmentId✅integerThe assignment's id (course module id), as list_assignments gives it
method✅rubric, guide
name✅stringIts name, as the advanced grading page lists it
descriptionstringIts description (HTML)
criteria✅object listIn order
commentsstring listA 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
InputRequiredTypeDescription
assignmentId✅integerThe assignment's id (course module id), as list_assignments gives it
userstringThe participant's alias, as the reading tools give it when the server pseudonymizes
userIdintegerThe participant's user id, when the server shows names
gradestringThe grade as text: a number within the range ("7.5"), or a scale item
feedbackstringFeedback comments (HTML); no aliases in it, since the student reads it
notifybooleanNotify the student; Moodle's default when missing
rubricobjectA rubric's level per criterion: criterion id → level id, as get_rubric gives them
guideobjectA marking guide's score per criterion: criterion id → score
remarksobjectRemarks per criterion of a rubric or guide: criterion id → text; no aliases
feedbackFilesstring listAbsolute local paths of feedback files to return to the student
workflowStatenotmarked, inmarking, readyforreview, inreview, readyforrelease, releasedWith the marking workflow on: the state to leave the submission in ("released" shows the student the grade)
applyToGroupbooleanIn a group assignment: give the same grade and feedback to the whole group
fieldsobjectOther 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
InputRequiredTypeDescription
assignmentId✅integerThe assignment's id (course module id), as list_assignments gives it
usersstring listThe participants' aliases, when the server pseudonymizes
userIdsinteger listThe participants' user ids, when the server shows names
until✅stringISO 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
InputRequiredTypeDescription
assignmentId✅integerThe assignment's id (course module id), as list_assignments gives it
usersstring listThe participants' aliases, as the reading tools give them when the server pseudonymizes
userIdsinteger listThe participants' user ids, when the server shows names
state✅inmarking, readyforreview, inreview, readyforrelease, released
notifyboolean

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
InputRequiredTypeDescription
assignmentId✅integerThe assignment's id (course module id), as list_assignments gives it
usersstring listThe participants' aliases, as the reading tools give them when the server pseudonymizes
userIdsinteger listThe participants' user ids, when the server shows names
markersstring listThe markers' aliases, when the server pseudonymizes
markerIdsinteger listThe markers' user ids, when the server shows names

Quizzes and questions​

ToolDescriptionRead onlyTeacherStudent
list_question_banksList a course's question banks✓✓
list_question_typesList the question types the site offers✓✓
list_questionsList a bank's questions✓✓
validate_giftCheck GIFT questions before importing them✓✓
import_questionsImport questions into a bank✓
create_questionCreate a question in a bank✓
update_questionChange a question in a bank✓
delete_questionsDelete questions from a bank✓
set_question_statusSet a question ready or draft✓
list_question_categoriesList a question bank's categories✓✓
add_question_categoryAdd a category to a question bank✓
edit_question_categoryRename or move a question category✓
delete_question_categoryDelete a question category✓
move_questionsMove questions to another category✓
export_questionsExport a bank's questions to a file✓✓
get_quiz_structureGet a quiz's questions✓✓
add_questions_to_quizAdd questions to a quiz✓
edit_quiz_slotChange a quiz question's mark or place✓
remove_quiz_slotRemove a question from a quiz✓
set_quiz_pagesSet a quiz's pages✓
add_quiz_sectionAdd a section to a quiz✓
get_quiz_resultsGet a quiz's results✓✓
get_quiz_statisticsRead a quiz's statistics✓✓
set_quiz_overrideSet a quiz override for a participant✓
list_questions_to_gradeList a quiz's questions to grade by hand✓✓
grade_quiz_questionGrade 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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
bankId✅integerThe 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
InputRequiredTypeDescription
bankId✅integerThe bank's id (a course module id), as list_question_banks gives it
limitintegerHow many questions (100 by default, up to 1000)
offsetintegerHow 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
InputRequiredTypeDescription
textstringThe questions in GIFT
filestringOr 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
InputRequiredTypeDescription
bankId✅integerThe bank's id (a course module id), as list_question_banks gives it
format✅gift, xml
textstringThe questions in that format
filestringOr an absolute path to a local file in that format
categoryIdintegerThe 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
InputRequiredTypeDescription
bankId✅integerThe 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✅stringThe question text (HTML)
answersobject listMultichoice, shortanswer and numerical answers
correctbooleanTruefalse: the right answer
pairsobject listmatch, ddmatch: each question and its answer; an answer without a question is a distractor
chooseintegerrandomsamatch: how many short-answer questions of the category it draws
choicesobject listddwtos, gapselect: the choices [[1]], [[2]]… in the text name, by position
imagestringddimageortext, ddmarker: the background image, an absolute local path
dragsobject listddimageortext: the draggable items
markersobject listddmarker: the markers
dropsobject listddimageortext, ddmarker: where the items or markers go
itemsstring listordering: the items, in the right order
wildcardsobject listcalculated, calculatedsimple, calculatedmulti: each {wildcard}'s values; Moodle's 1 to 10 without them
setsintegerCalculated types: how many sets of values (10 by default)
coderunnerobjectcoderunner (a plugin)
formulasobjectformulas (a plugin)
categoryIdintegerThe bank category, as list_questions gives it; the bank's default when missing
defaultMarknumber
fieldsobjectAny 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
InputRequiredTypeDescription
bankId✅integerThe bank's id (a course module id), as list_question_banks gives it
questionId✅integerAs list_questions gives it
namestring
textstringThe question text (HTML)
answersobject listMultichoice, shortanswer and numerical answers
correctbooleanTruefalse: the right answer
pairsobject listmatch, ddmatch: each question and its answer; an answer without a question is a distractor
chooseintegerrandomsamatch: how many short-answer questions of the category it draws
choicesobject listddwtos, gapselect: the choices [[1]], [[2]]… in the text name, by position
imagestringddimageortext, ddmarker: the background image, an absolute local path
dragsobject listddimageortext: the draggable items
markersobject listddmarker: the markers
dropsobject listddimageortext, ddmarker: where the items or markers go
itemsstring listordering: the items, in the right order
wildcardsobject listcalculated, calculatedsimple, calculatedmulti: each {wildcard}'s values; Moodle's 1 to 10 without them
setsintegerCalculated types: how many sets of values (10 by default)
coderunnerobjectcoderunner (a plugin)
formulasobjectformulas (a plugin)
categoryIdintegerThe bank category, as list_questions gives it; the bank's default when missing
defaultMarknumber
fieldsobjectAny 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
InputRequiredTypeDescription
bankId✅integerThe bank's id (a course module id), as list_question_banks gives it
questionIds✅integer listAs 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
InputRequiredTypeDescription
questionId✅integerAs 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
InputRequiredTypeDescription
bankId✅integerThe 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
InputRequiredTypeDescription
bankId✅integerThe bank's id, as list_question_banks gives it (on Moodle 4.x, the course's id)
name✅string
parentIdinteger
descriptionstring

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
InputRequiredTypeDescription
bankId✅integerThe bank's id, as list_question_banks gives it (on Moodle 4.x, the course's id)
categoryId✅integerThe category's id, as list_question_categories gives it
namestring
descriptionstring
parentIdinteger

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
InputRequiredTypeDescription
bankId✅integerThe bank's id, as list_question_banks gives it (on Moodle 4.x, the course's id)
categoryId✅integerThe category's id, as list_question_categories gives it
moveTointegerWhere 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
InputRequiredTypeDescription
bankId✅integerThe bank's id, as list_question_banks gives it (on Moodle 4.x, the course's id)
questionIds✅integer listAs list_questions gives them
categoryId✅integerThe 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
InputRequiredTypeDescription
bankId✅integerThe bank's id, as list_question_banks gives it (on Moodle 4.x, the course's id)
format✅gift, xml
categoryIdintegerOnly this category; the whole bank when missing
file✅stringAn 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
InputRequiredTypeDescription
quizId✅integerThe 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
InputRequiredTypeDescription
quizId✅integerThe quiz's id (course module id), as get_course_structure gives it
questionIdsinteger listBank questions, as list_questions gives them
randomobjectRandom questions drawn from a category
pageintegerThe 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
InputRequiredTypeDescription
quizId✅integerThe quiz's id (course module id), as get_course_structure gives it
slot✅integerThe slot's place in the quiz, from 1, as get_quiz_structure gives it
maxMarknumber
moveAfterintegerPut it after this slot (0: first)
pageintegerThe 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
InputRequiredTypeDescription
quizId✅integerThe quiz's id (course module id), as get_course_structure gives it
slot✅integerThe 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
InputRequiredTypeDescription
quizId✅integerThe quiz's id (course module id), as get_course_structure gives it
perPageintegerQuestions per page; 0 for one page
breaksAfterinteger listOr: 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
InputRequiredTypeDescription
quizId✅integerThe quiz's id (course module id), as get_course_structure gives it
firstSlot✅integerThe slot's place in the quiz, from 1, as get_quiz_structure gives it
heading✅string
shuffleboolean

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
InputRequiredTypeDescription
quizId✅integerThe quiz's id (course module id), as get_course_structure gives it
responsesbooleanAlso the answer per question (default false)
limitintegerHow many attempts (50 by default, up to 500)
offsetintegerHow 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
InputRequiredTypeDescription
quizId✅integerThe quiz's id (course module id), as get_course_structure gives it
attemptshighest, all, first, lastThe quiz's grading method by default
recalculatebooleanCalculate again now, for attempts finished since
responsesbooleanAlso 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
InputRequiredTypeDescription
quizId✅integerThe quiz's id (course module id)
userstringThe participant's alias, as the reading tools give it when the server pseudonymizes
userIdintegerThe participant's user id, when the server shows names
openstringISO 8601
closestringISO 8601
timeLimitMinutesinteger
attemptsinteger0 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
InputRequiredTypeDescription
quizId✅integerThe 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
InputRequiredTypeDescription
attemptId✅integerAs list_questions_to_grade gives it
slot✅integer
mark✅number
commentstringNo aliases in it, since the student reads it

Gradebook and progress​

ToolDescriptionRead onlyTeacherStudent
get_grader_reportGet a course's grades✓✓
set_gradeSet a grade in the gradebook✓
export_gradesExport a course's grades to a file✓✓
get_gradebook_setupGet a course's gradebook setup✓✓
add_grade_itemAdd a manual grade item✓
update_grade_itemUpdate a grade item✓
delete_grade_itemDelete a manual grade item✓
add_grade_categoryAdd a grade category✓
update_grade_categoryUpdate a grade category✓
delete_grade_categoryDelete a grade category✓
import_gradesImport grades from a CSV file✓
list_scalesList a course's scales✓✓
add_scaleAdd a scale to a course✓
edit_scaleChange a course's scale✓
get_grade_lettersRead a course's grade letters✓✓
set_grade_lettersSet a course's grade letters✓
get_completion_reportGet a course's activity completion✓✓
override_completionSet a participant's activity completion✓
get_course_completion_criteriaRead a course's completion criteria✓✓
set_course_completion_criteriaSet what completes a course✓
get_course_completion_statusRead who has completed a course✓✓
mark_course_completeMark 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
InputRequiredTypeDescription
courseId✅integer
groupintegerOnly 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
InputRequiredTypeDescription
courseId✅integer
itemId✅integerThe grade item, as get_gradebook_setup or get_grader_report gives it
userstringThe participant's alias, as the reading tools give it when the server pseudonymizes
userIdintegerThe participant's user id, when the server shows names
gradestring
feedbackstringNo aliases in it, since the student reads it
overridebooleanfalse: take an activity's or category's override off
excludedbooleanExclude 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
InputRequiredTypeDescription
courseId✅integer
format✅xlsx, ods, csv, xml
destDir✅stringAn absolute local folder
itemIdsinteger listOnly these grade items
groupIdinteger
displayreal, percentage, letter list
feedbackbooleanInclude 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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
courseId✅integer
name✅string
maxGradenumber
scaleIdintegerA scale instead of points
categoryIdintegerThe category to put it in, as get_gradebook_setup gives it
hiddenboolean

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
InputRequiredTypeDescription
courseId✅integer
itemId✅integer
categoryintegerThe category to move it into
weightnumberPercent
maxGradenumber

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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
courseId✅integer
name✅string
aggregationmean, median, lowest, highest, mode, weighted-mean, simple-weighted-mean, mean-with-extra-credits, natural
parentIdintegerThe 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
InputRequiredTypeDescription
courseId✅integer
categoryId✅integer
namestring
aggregationmean, median, lowest, highest, mode, weighted-mean, simple-weighted-mean, mean-with-extra-credits, natural
weightnumberPercent
parentIdintegerThe 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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
courseId✅integer
file✅stringAn absolute local path to the CSV
mapFrom✅stringThe column (its header) that identifies each person
mapTo✅id, username, idnumber, email
itemsobjectColumn header → grade item id
feedbackobjectColumn header → the grade item whose feedback it is
previewbooleanOnly show how Moodle reads the file
separatorcomma, semicolon, tab, colon
encodingstringOne 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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
courseId✅integer
name✅string
items✅string list
descriptionstring

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
InputRequiredTypeDescription
courseId✅integer
scaleId✅integerAs list_scales gives it
namestring
itemsstring list
descriptionstring

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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
courseId✅integer
lettersobject list
useDefaultsbooleanThe 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
InputRequiredTypeDescription
courseId✅integer
groupintegerOnly 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
InputRequiredTypeDescription
activityId✅integerThe activity's id (course module id)
userstringThe participant's alias, as the reading tools give it when the server pseudonymizes
userIdintegerThe 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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
courseId✅integer
overallall, any
activitiesobject
coursesobject
datestringComplete on this day
enrolmentDaysinteger1 to 30, 40 to 180 by tens, or 365
unenrolmentboolean
gradenumberIn the course total's points
selfboolean
rolesobject
removeactivities, courses, date, enrolmentDays, grade, roles listCriteria to take away
unlockbooleanUnlock 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
InputRequiredTypeDescription
courseId✅integer
userstringThe participant's alias, as the reading tools give it when the server pseudonymizes
userIdintegerThe participant's user id, when the server shows names
groupIdintegerOnly this group's participants
limitintegerHow many participants (50 by default, up to 200)
offsetintegerHow 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
InputRequiredTypeDescription
courseId✅integer
userstringThe participant's alias, as the reading tools give it when the server pseudonymizes
userIdintegerThe participant's user id, when the server shows names

Badges​

ToolDescriptionRead onlyTeacherStudent
list_badgesList a course's badges✓✓✓
create_badgeCreate a course badge✓
set_badge_criteriaSet what earns a badge✓
set_badge_enabledEnable or disable a badge✓
award_badgeAward 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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
courseId✅integer
name✅string
description✅stringPlain text: Moodle strips tags
image✅stringAn absolute local path to its image: PNG, JPEG or GIF, at most 256 KB
imageCaptionstringThe 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
InputRequiredTypeDescription
badgeId✅integerThe badge's id, as list_badges gives it
activitiesobject
courseCompletionobject
manualobject
allbooleanWith more than one criterion: all must be met, or any one
removeactivities, courseCompletion, manual listCriteria 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
InputRequiredTypeDescription
badgeId✅integerThe 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
InputRequiredTypeDescription
badgeId✅integerThe badge's id, as list_badges gives it
userstringThe participant's alias, as the reading tools give it when the server pseudonymizes
userIdintegerThe participant's user id, when the server shows names
roleIdintegerThe 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.

ToolDescriptionRead onlyTeacherStudent
list_course_blocksList a course page's blocks✓✓
add_blockAdd a block to a course page✓
configure_blockConfigure a course page's block✓
move_blockMove a course page's block✓
delete_blockDelete a course page's block✓
list_content_bankList a course's content bank✓✓
upload_to_content_bankUpload H5P content to a course's content bank✓
rename_contentRename content in a content bank✓
download_contentDownload content from a content bank✓
delete_contentDelete content from a content bank✓
get_bigbluebuttonRead a BigBlueButton activity✓✓✓
get_bigbluebutton_join_urlGet the link to join a BigBlueButton meeting✓✓✓
set_recording_publishedPublish or hide a BigBlueButton recording✓
delete_recordingDelete a BigBlueButton recording✓
list_notesRead notes about a course's participants✓✓
add_noteWrite a note about a participant✓
edit_noteChange a note about a participant✓
delete_noteDelete a note about a participant✓
list_competency_frameworksList the competency frameworks a course can use✓✓
list_course_competenciesList a course's competencies✓✓
add_course_competencyAdd a competency to a course✓
remove_course_competencyRemove a competency from a course✓
set_activity_competenciesLink competencies to an activity✓
get_competency_ratingRead a participant's rating in a competency✓✓✓
rate_competencyRate a participant in a competency✓
list_external_toolsList a course's external tools✓✓
add_external_toolAdd an external tool to a course✓
set_external_tool_in_chooserShow an external tool in the activity chooser✓
delete_external_toolDelete a course's external tool✓
get_external_tool_launch_urlGet 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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
courseId✅integer
type✅stringhtml for a text block, or another block's plugin name
regionstring
titlestring
contentstringA text block's HTML
embedstring listAbsolute 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
InputRequiredTypeDescription
courseId✅integer
blockId✅integerThe block's id, as list_course_blocks gives it
titlestring
contentstring
embedstring listAbsolute local files the content names, which go in it: <img src="shot.png">
settingsobjectOther 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
InputRequiredTypeDescription
courseId✅integer
blockId✅integerThe block's id, as list_course_blocks gives it
regionstring
weightinteger

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
InputRequiredTypeDescription
courseId✅integer
blockId✅integerThe 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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
courseId✅integer
file✅stringAn 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
InputRequiredTypeDescription
contentId✅integerThe 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
InputRequiredTypeDescription
contentId✅integerThe content's id, as list_content_bank gives it
destDir✅stringAn 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
InputRequiredTypeDescription
contentId✅integerThe 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
InputRequiredTypeDescription
activityId✅integerThe 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
InputRequiredTypeDescription
activityId✅integerThe 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
InputRequiredTypeDescription
activityId✅integerThe BigBlueButton activity's id (course module id), as get_course_structure gives it
recordingId✅integerThe 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
InputRequiredTypeDescription
activityId✅integerThe BigBlueButton activity's id (course module id), as get_course_structure gives it
recordingId✅integerThe 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
InputRequiredTypeDescription
courseId✅integer
userstringThe participant's alias, as the reading tools give it when the server pseudonymizes
userIdintegerThe participant's user id, when the server shows names
limitintegerHow many notes (50 by default, up to 200)
offsetintegerHow 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
InputRequiredTypeDescription
courseId✅integer
userstringThe participant's alias, as the reading tools give it when the server pseudonymizes
userIdintegerThe participant's user id, when the server shows names
content✅string
contextpersonal, course, sitepersonal: 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
InputRequiredTypeDescription
noteId✅integerThe note's id, as list_notes gives it
contentstring
contextpersonal, course, sitepersonal: 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
InputRequiredTypeDescription
noteId✅integerThe 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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
courseId✅integer
competencyId✅integerThe 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
InputRequiredTypeDescription
courseId✅integer
competencyId✅integerThe 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
InputRequiredTypeDescription
activityId✅integerAs get_course_structure gives it
competencyIds✅integer listThe 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
InputRequiredTypeDescription
courseId✅integer
competencyId✅integerThe competency's id, as list_competency_frameworks or list_course_competencies gives it
userstringThe participant's alias, as the reading tools give it when the server pseudonymizes
userIdintegerThe 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
InputRequiredTypeDescription
courseId✅integer
competencyId✅integerThe competency's id, as list_competency_frameworks or list_course_competencies gives it
userstringThe participant's alias, as the reading tools give it when the server pseudonymizes
userIdintegerThe participant's user id, when the server shows names
rating✅stringThe scale item's value ("2") or name
notestring

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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
courseId✅integer
name✅string
url✅stringThe tool's launch URL, or a cartridge's
descriptionstring
keystringThe consumer key
secretstringThe shared secret
settingsobjectOther 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
InputRequiredTypeDescription
courseId✅integer
toolId✅integerThe 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
InputRequiredTypeDescription
courseId✅integer
toolId✅integerThe 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
InputRequiredTypeDescription
activityId✅integerThe LTI activity's id (course module id), as get_course_structure gives it

Reports​

ToolDescriptionRead onlyTeacherStudent
get_activity_reportGet a course's activity views✓✓
get_participation_reportGet who took part in an activity✓✓
get_course_logsGet a course's logs✓✓
get_choice_resultsRead a choice's results✓✓
get_survey_resultsRead 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
InputRequiredTypeDescription
courseId✅integer
fromstringISO 8601
untilstringISO 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
InputRequiredTypeDescription
courseId✅integer
activityId✅integer
roleIdinteger
sincestringISO 8601
actionview, 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
InputRequiredTypeDescription
courseId✅integer
userstringThe participant's alias, as the reading tools give it when the server pseudonymizes
userIdintegerThe participant's user id, when the server shows names
activityIdinteger
actioncreate, view, update, delete, change
fromstringISO 8601
untilstringISO 8601
limitintegerHow many entries (50 by default)
offsetintegerHow many entries to skip first, newest first (0 by default)
includeDescriptionsbooleanAlso 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
InputRequiredTypeDescription
choiceId✅integerThe 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
InputRequiredTypeDescription
activityId✅integerThe activity's id (course module id), as get_course_structure gives it
typequestionnaire, feedbackThe activity's type, as get_course_structure gives it; found when missing

Participants and groups​

ToolDescriptionRead onlyTeacherStudent
list_participantsList a course's participants✓✓✓
list_potential_usersFind users to enrol✓✓
enrol_usersEnrol users in a course✓
unenrol_userUnenrol a user from a course✓
set_user_rolesSet someone's roles in a course✓
list_enrolment_methodsList a course's enrolment methods✓✓
set_enrolment_methodSet an enrolment method✓
list_groupsList a course's groups✓✓✓
create_groupCreate a group✓
update_groupChange a group✓
delete_groupDelete a group✓
set_group_membersAdd or remove a group's members✓
list_groupingsList a course's groupings✓✓
create_groupingCreate a grouping✓
delete_groupingDelete a grouping✓
set_grouping_groupsSet a grouping's groups✓
auto_create_groupsCreate groups automatically✓
import_groupsImport 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
InputRequiredTypeDescription
courseId✅integer
roleintegerOnly this role's, by its id (as the participants' roles give it)
groupintegerOnly this group's members, by its id from list_groups
inactiveSincestringOnly those who haven't accessed the course since this date (ISO 8601)
limitintegerHow many participants (50 by default, up to 500)
offsetintegerHow 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
InputRequiredTypeDescription
courseId✅integer
searchstringPart 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
InputRequiredTypeDescription
courseId✅integer
usersstring listThe participants' aliases, as the reading tools give them when the server pseudonymizes
userIdsinteger listThe participants' user ids, when the server shows names
roleIdintegerThe role to give, as list_participants' roles give it
startstringISO 8601
endstringISO 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
InputRequiredTypeDescription
courseId✅integer
userstringThe participant's alias, as the reading tools give it when the server pseudonymizes
userIdintegerThe 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
InputRequiredTypeDescription
courseId✅integer
userstringThe participant's alias, as the reading tools give it when the server pseudonymizes
userIdintegerThe participant's user id, when the server shows names
roleIds✅integer listRole 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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
courseId✅integer
methodIdintegerAs list_enrolment_methods gives it
methodTypestringOr the method's type, such as "self" or "guest"
enabledboolean
keystringSelf enrolment or guest access key; empty to remove it
startstringFrom when, ISO 8601; "none" to remove it
endstringUntil when, ISO 8601; "none" to remove it
roleIdinteger
maxUsersinteger0 for no limit
welcomeMessagestringSelf enrolment: send this welcome message
noWelcomebooleanSelf 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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
courseId✅integer
name✅string
descriptionstringHTML
idNumberstringAn id for external systems
enrolmentKeystringA 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
InputRequiredTypeDescription
groupId✅integerThe group's id, as list_groups gives it
namestring
descriptionstringHTML
idNumberstringAn id for external systems
enrolmentKeystringA 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
InputRequiredTypeDescription
groupId✅integerThe 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
InputRequiredTypeDescription
courseId✅integerThe group's course
groupId✅integerAs list_groups gives it
addstring listAliases to add, when the server pseudonymizes
removestring listAliases to remove, when the server pseudonymizes
addIdsinteger listUser ids to add, when the server shows names
removeIdsinteger listUser 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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
courseId✅integer
name✅string
descriptionstringHTML
idNumberstring

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
InputRequiredTypeDescription
groupingId✅integerThe 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
InputRequiredTypeDescription
groupingId✅integerThe 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
InputRequiredTypeDescription
courseId✅integer
by✅groups, membersgroups: count groups; members: groups of count members
count✅integer
naming✅stringThe groups' names: # becomes their number, @ a letter ("Group @")
allocationrandom, firstname, lastname, idnumber, nonerandom by default; none leaves them empty
roleIdintegerOnly this role (0: every role); students by default
cohortIdinteger
fromGroupingIdinteger
fromGroupIdinteger
notInGroupbooleanOnly participants in no group yet
noSmallGroupsbooleanWith members: spread a last group that would be too small over the others
groupingIdintegerPut them in this grouping
newGroupingstringOr in a new grouping of this name
previewboolean
seedintegerA 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
InputRequiredTypeDescription
courseId✅integer
file✅stringAn absolute local path to the CSV
delimitercomma, semicolon, colon, tab

Forums, workshops and messages​

ToolDescriptionRead onlyTeacherStudent
list_discussionsList a forum's discussions✓✓✓
get_discussionRead a forum discussion✓✓✓
reply_to_postReply to a forum post✓✓
create_discussionStart a forum discussion✓✓
edit_postEdit a forum post✓✓
delete_postDelete a forum post✓✓
set_discussion_statePin or lock a discussion✓
set_discussion_subscriptionSubscribe to a forum discussion✓✓
get_forum_gradesGet a forum's whole-forum grades✓✓
grade_forum_userGive a whole-forum grade✓
rateRate a post, entry or record✓✓
get_workshopRead a workshop✓✓
set_workshop_phaseSwitch a workshop's phase✓
assess_workshop_submissionAssess a workshop submission✓✓
get_workshop_submissionRead a workshop submission✓✓✓
save_workshop_submissionSubmit to a workshop✓✓
list_workshop_examplesList a workshop's example submissions✓✓
add_workshop_exampleAdd an example submission to a workshop✓
edit_workshop_exampleChange a workshop's example submission✓
delete_workshop_exampleDelete a workshop's example submission✓
assess_workshop_exampleAssess a workshop's example submission✓✓
calculate_workshop_gradesCalculate a workshop's grades✓
override_workshop_gradeOverride a workshop grade✓
get_workshop_allocationRead who assesses whom in a workshop✓✓
allocate_workshop_reviewerAllocate a reviewer to a workshop submission✓
remove_workshop_reviewerRemove a reviewer from a workshop submission✓
allocate_workshop_randomlyAllocate a workshop's reviewers at random✓
schedule_workshop_allocationSchedule a workshop's random allocation✓
list_notificationsList my notifications✓✓✓
mark_notifications_readMark my notifications read✓✓
list_conversationsList my conversations✓✓✓
get_conversationRead a conversation✓✓✓
send_messageSend a private message✓✓
message_participantsMessage 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
InputRequiredTypeDescription
forumId✅integerThe forum's id (its course module id), as get_course_structure gives it
limitintegerHow many discussions (30 by default, up to 100)
offsetintegerHow 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
InputRequiredTypeDescription
discussionId✅integerThe discussion id, as list_discussions gives it
limitintegerHow many posts (50 by default, up to 200)
offsetintegerHow 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
InputRequiredTypeDescription
postId✅integerThe post to reply to, as get_discussion gives it
subjectstring
message✅stringThe message (HTML); no aliases in it, since people read it
filesstring listAbsolute local paths to attach
embedstring listAbsolute local files (images…) to embed in the HTML, which names each by its file name: <img src="shot.png">
subscribebooleanSubscribe to the discussion; Moodle's default when missing
fieldsobjectOther 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
InputRequiredTypeDescription
forumId✅integerThe forum's id (course module id), as get_course_structure gives it
subject✅string
message✅stringThe message (HTML); no aliases in it, since people read it
filesstring listAbsolute local paths to attach
embedstring listAbsolute local files (images…) to embed in the HTML, which names each by its file name: <img src="shot.png">
subscribebooleanSubscribe to the discussion; Moodle's default when missing
fieldsobjectOther 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
InputRequiredTypeDescription
postId✅integerAs get_discussion gives it
subjectstring
messagestringHTML; no aliases in it, since people read it
addFilesstring listAbsolute local paths to attach
removeFilesstring listAttachments' names to remove
embedstring listAbsolute 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
InputRequiredTypeDescription
postId✅integerAs 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
InputRequiredTypeDescription
forumId✅integerThe forum's id (course module id), as get_course_structure gives it
discussionId✅integerAs list_discussions gives it
pinnedboolean
lockedboolean

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
InputRequiredTypeDescription
forumId✅integerThe forum's id (course module id), as get_course_structure gives it
discussionId✅integerAs 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
InputRequiredTypeDescription
forumId✅integerThe forum's id (course module id)
groupIdinteger

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
InputRequiredTypeDescription
forumId✅integerThe forum's id (course module id)
userstringThe participant's alias, as the reading tools give it when the server pseudonymizes
userIdintegerThe participant's user id, when the server shows names
grade✅string
notifyboolean

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
InputRequiredTypeDescription
itemType✅forum-post, glossary-entry, database-record
itemId✅integerThe post's, entry's or record's id
discussionIdintegerFor 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
InputRequiredTypeDescription
workshopId✅integerThe 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
InputRequiredTypeDescription
workshopId✅integerThe 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
InputRequiredTypeDescription
workshopId✅integerThe workshop's id (course module id)
submissionId✅integerAs get_workshop gives it
criteriaobject listIn the form's order
feedbackstringOverall feedback for the author (HTML); no aliases in it
fieldsobjectAny 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
InputRequiredTypeDescription
workshopId✅integerThe workshop's id (course module id)
submissionIdintegerAs get_workshop gives it
authorstringOr its author's alias, when the server pseudonymizes
authorIdintegerOr 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
InputRequiredTypeDescription
workshopId✅integerThe workshop's id (course module id)
titlestringIts title; a new one needs it
contentstringIts text (HTML), where the workshop takes online text; no aliases in it
attachmentsstring listAbsolute local paths: they replace the files attached before
embedstring listAbsolute 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
InputRequiredTypeDescription
workshopId✅integerThe 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
InputRequiredTypeDescription
workshopId✅integerThe workshop's id (course module id)
title✅string
contentstringIts text (HTML), where the workshop takes online text; no aliases in it
attachmentsstring listAbsolute local paths: they replace the files attached before
embedstring listAbsolute 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
InputRequiredTypeDescription
workshopId✅integerThe workshop's id (course module id)
exampleId✅integerAs list_workshop_examples gives it
titlestringIts title; a new one needs it
contentstringIts text (HTML), where the workshop takes online text; no aliases in it
attachmentsstring listAbsolute local paths: they replace the files attached before
embedstring listAbsolute 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
InputRequiredTypeDescription
workshopId✅integerThe workshop's id (course module id)
exampleId✅integerAs 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
InputRequiredTypeDescription
workshopId✅integerThe workshop's id (course module id)
exampleId✅integerAs list_workshop_examples gives it
criteriaobject listIn the form's order
feedbackstringOverall feedback for the author (HTML); no aliases in it
fieldsobjectAny 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
InputRequiredTypeDescription
workshopId✅integerThe workshop's id (course module id)
comparisonvery strict, strict, fair, lax, very laxHow 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
InputRequiredTypeDescription
workshopId✅integerThe workshop's id (course module id)
submissionIdinteger
assessmentIdinteger
gradeintegerA whole number up to the workshop's grade for submission (or for assessment)
removebooleanTake the override away instead
feedbackstringHTML; 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
InputRequiredTypeDescription
workshopId✅integerThe 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
InputRequiredTypeDescription
workshopId✅integerThe workshop's id (course module id)
submissionIdintegerThe submission, as get_workshop_allocation gives it; or its author
authorstringThe submission's author's alias, when the server pseudonymizes
authorIdintegerThe submission's author's user id, when the server shows names
reviewerstringThe reviewer's alias, when the server pseudonymizes
reviewerIdintegerThe 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
InputRequiredTypeDescription
workshopId✅integerThe workshop's id (course module id)
submissionIdintegerThe submission, as get_workshop_allocation gives it; or its author
authorstringThe submission's author's alias, when the server pseudonymizes
authorIdintegerThe submission's author's user id, when the server shows names
reviewerstringThe reviewer's alias, when the server pseudonymizes
reviewerIdintegerThe reviewer's user id, when the server shows names
evenIfAssessedbooleanAlso 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
InputRequiredTypeDescription
workshopId✅integerThe workshop's id (course module id)
perSubmissionintegerReviews each submission gets; or perReviewer
perReviewerintegerReviews each reviewer does
keepCurrentbooleanKeep the allocations there are (default); false removes them first, never graded ones
withoutSubmissionbooleanReviewers without a submission of their own too; off by default
selfAssessmentbooleanAdd each author's self-assessment, where the workshop allows it
excludeSameGroupbooleanNo 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
InputRequiredTypeDescription
workshopId✅integerThe workshop's id (course module id)
enabled✅boolean
perSubmissionintegerReviews each submission gets; or perReviewer
perReviewerintegerReviews each reviewer does
keepCurrentbooleanKeep the allocations there are (default); false removes them first, never graded ones
withoutSubmissionbooleanReviewers without a submission of their own too; off by default
selfAssessmentbooleanAdd each author's self-assessment, where the workshop allows it
excludeSameGroupbooleanNo 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
InputRequiredTypeDescription
unreadOnlyboolean
limitintegerHow many (30 by default)
offsetintegerHow 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
InputRequiredTypeDescription
limitintegerHow many conversations (20 by default, up to 100)
offsetintegerHow 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
InputRequiredTypeDescription
conversationId✅integer
limitintegerHow many messages (50 by default, up to 200)
offsetintegerHow 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
InputRequiredTypeDescription
userstringThe participant's alias, as the reading tools give it when the server pseudonymizes
userIdintegerThe 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
InputRequiredTypeDescription
courseId✅integer
text✅string
usersstring listThe participants' aliases, as the reading tools give them when the server pseudonymizes
userIdsinteger listThe participants' user ids, when the server shows names
roleintegerOr: everyone with this role
groupintegerOr: everyone in this group
inactiveSincestringOr: everyone who hasn't accessed the course since this date (ISO 8601)

Calendar and to-dos​

ToolDescriptionRead onlyTeacherStudent
list_eventsList upcoming calendar events✓✓✓
get_eventRead a calendar event✓✓✓
create_eventCreate a course event✓
update_eventChange a calendar event✓
delete_eventDelete a calendar event✓
list_deadlinesList upcoming deadlines✓✓✓
list_pendingList what I have left✓✓
get_activities_overviewGet a course's activities overview✓✓✓
get_course_updatesGet 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
InputRequiredTypeDescription
courseIdintegerOnly 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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
courseId✅integer
name✅string
start✅stringISO 8601, e.g. 2026-11-03T10:00:00+01:00
durationMinutesinteger
descriptionstringHTML

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
InputRequiredTypeDescription
eventId✅integer
namestring
descriptionstringHTML
startstringISO 8601
durationMinutesinteger
untilstringOr the end, ISO 8601
locationstring
wholeSeriesbooleanFor 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
InputRequiredTypeDescription
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
InputRequiredTypeDescription
courseIdintegerOne course; every course when missing
daysintegerHow 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
InputRequiredTypeDescription
courseId✅integerThe 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
InputRequiredTypeDescription
courseId✅integerThe course's id, from list_courses
typestringOne 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
InputRequiredTypeDescription
courseId✅integerThe course's id, from list_courses
sincestringISO date and time; a week ago when missing

As a student​

ToolDescriptionRead onlyTeacherStudent
get_my_gradesGet my grades✓✓
get_assignmentGet an assignment as a student✓✓
save_submissionSave my submission✓
submit_assignmentSubmit my assignment for grading✓
get_quiz_infoGet a quiz's information and my attempts✓✓✓
start_quiz_attemptStart or continue a quiz attempt✓
get_quiz_attemptRead an attempt's questions✓✓
answer_quiz_questionsAnswer quiz questions✓
finish_quiz_attemptSubmit a quiz attempt✓
get_attempt_reviewReview a finished attempt✓✓✓
get_surveyGet a survey's questions✓✓
submit_surveyAnswer and submit a survey✓
get_choiceRead a choice✓✓✓
answer_choiceAnswer a choice✓
get_lesson_pageRead the current lesson page✓
answer_lesson_pageAnswer a lesson page✓
get_h5p_activityRead an H5P activity✓✓✓
get_scormRead a SCORM activity✓✓✓
open_scormOpen a SCORM package to do it✓
set_completionMark 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
InputRequiredTypeDescription
courseId✅integerThe 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
InputRequiredTypeDescription
assignmentId✅integerThe 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
InputRequiredTypeDescription
assignmentId✅integerThe assignment's id (course module id), as get_course_structure gives it
onlineTextstring
filesstring 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
InputRequiredTypeDescription
assignmentId✅integerThe assignment's id (course module id), as get_course_structure gives it
acceptStatementbooleanThe 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
InputRequiredTypeDescription
quizId✅integerThe 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
InputRequiredTypeDescription
quizId✅integerThe 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
InputRequiredTypeDescription
attemptId✅integerThe 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
InputRequiredTypeDescription
attemptId✅integerThe 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
InputRequiredTypeDescription
attemptId✅integerThe 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
InputRequiredTypeDescription
attemptId✅integerThe 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
InputRequiredTypeDescription
activityId✅integerThe survey's id (course module id), as get_course_structure gives it
type✅questionnaire, feedbackThe 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
InputRequiredTypeDescription
activityId✅integerThe survey's id (course module id), as get_course_structure gives it
type✅questionnaire, feedbackThe 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
InputRequiredTypeDescription
activityId✅integerThe 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
InputRequiredTypeDescription
activityId✅integerThe 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
InputRequiredTypeDescription
activityId✅integerThe 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
InputRequiredTypeDescription
activityId✅integerThe activity's id (course module id), as get_course_structure gives it
buttonstringA content page's button, by its label
buttonPositionintegerOr by its position, from 1
responsesobjectA 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
InputRequiredTypeDescription
activityId✅integerThe 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
InputRequiredTypeDescription
activityId✅integerThe 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
InputRequiredTypeDescription
activityId✅integerThe SCORM activity's id (course module id), as get_course_structure gives it
scoIdintegerThe SCO to open, as get_scorm gives it; the first when missing
newAttemptbooleanStart 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
InputRequiredTypeDescription
activityId✅integerThe 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).

ToolDescriptionRead onlyTeacherStudent
browser_navigateBrowser: open a page✓✓
browser_snapshotBrowser: read the page✓✓✓
browser_clickBrowser: click✓✓
browser_typeBrowser: type✓✓
browser_selectBrowser: choose options✓✓
browser_uploadBrowser: choose files✓✓
browser_screenshotBrowser: screenshot✓✓✓
browser_waitBrowser: 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
InputRequiredTypeDescription
url✅stringA 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
InputRequiredTypeDescription
scopemain, page"main" (default): Moodle's main region; "page": everything, navigation included
refstringOnly 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
InputRequiredTypeDescription
ref✅stringThe element's ref from the latest browser_snapshot, like e12
doubleClickboolean

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
InputRequiredTypeDescription
ref✅stringThe element's ref from the latest browser_snapshot, like e12
text✅string
submitbooleanPress 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
InputRequiredTypeDescription
ref✅stringThe 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
InputRequiredTypeDescription
ref✅stringThe element's ref from the latest browser_snapshot, like e12
paths✅string listAbsolute paths of local files

browser_screenshot​

Browser: screenshot

note

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
InputRequiredTypeDescription
refstringThe 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
InputRequiredTypeDescription
textstringWait until this text shows
textGonestringWait until this text is gone
secondsnumberWait this long (with a text: the most to wait; default 10)