It is possible to use AI Agents such as Claude Code to generate MiniLessons. This is a beta feature that at Poodll we are using internally but you are welcome to try it out on your own Moodle site.
Requirements
- Poodll MiniLesson version 1.1.37 (2026052800) or greater
- A correctly configured webservice user (see below)
- An ai agent platform such as Claude Code, Cursor, or Antigravity (see below)
The AI Agent Platform
Poodll MiniLesson just publishes a nice API document that your agent reads and figures out what it needs to do. But its not an MCP server and because of some Moodle limitations it won't load up correctly in a custom GPT. We decided to wait a little and see what Moodle comes out with before building an MCP server. While it could be rewritten to support a custom GPT it works well enough from Claude Code / Cursor / Antigravity for now. If you need more than that let us now.
The Web Service User
The user (users) must
- Not be site administrators
- Have permission: webservice/rest:use
- Be added to authorized users at :
Site administration -> Server -> Web Services -> External Services - Ai Generation Service - [optional] have permission: moodle/webservice:createtoken
This allows the agent to generate a token using the web service user's username and password.
If you do not want the agent to do that, then you could skip this and just generate a token at:
Site administration -> Server -> Web Services -> Manage tokens
In that case you would give the token to the agent in your instructions.
In additon web services must be enabled at:
Site administration -> General -> Advanced features
And the REST protocol must be enabled at:
Site administration -> Server -> Web Services -> Manage Protocols
The APIs and OpenAPI JSON document
The URL to the API specification for the agent is at :
[your moodle url]/mod/minilesson/openapi.php
you can see one here:
https://demo.poodll.com/mod/minilesson/openapi.php
The APIs that exposes are :
| Endpoint Path | HTTP Method | Moodle wsfunction | Summary / Description |
/login/token.php | POST | None | Authentication: Exchange a Moodle username and password for a valid wstoken. |
/mod_minilesson_list_courses | GET | mod_minilesson_list_courses | Lists available Moodle courses including basic metadata and enrollment counts. |
/mod_minilesson_aigen_list_templates | GET | mod_minilesson_aigen_list_templates | Retrieves available AI generation activity templates, their required inputs, and expected outputs. |
/mod_minilesson_aigen_list_minilessons | GET | mod_minilesson_aigen_list_minilessons | Lists all existing MiniLesson module instances located inside a specific course. |
/mod_minilesson_aigen_create_empty_lesson | POST | mod_minilesson_aigen_create_empty_lesson | Provisions a new, empty MiniLesson activity instance container inside a course section. |
/mod_minilesson_aigen_create_add_items_to_lesson | POST | mod_minilesson_aigen_create_add_items_to_lesson | Dispatches an asynchronous background task to generate AI material and append it to a lesson. Returns a tracking jobid. |
/mod_minilesson_aigen_fetch_create_items_status | POST | mod_minilesson_aigen_fetch_create_items_status | Polls the real-time execution status and completion logs for one or more background generation jobs. |
Putting it all together
Open up your agent and instruct it to fetch the API spec from the openapi url (above) and then give it either the pre-generated web service user's web service token, or the web service user's username and password. A series of commands after that might look like:
- "fetch my courses"
- "create a new minilesson titled '[lesson name]'" in course [course name]
- "list the ai generate templates"
- "use [template name] to add items for ESL learners of CEFR level: A2 to [lesson name] using topic: [topic name] and vocabulary [some words].
- "Check every 30 seconds or so to see when its finished"
Good Luck