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

  1. Not be site administrators
  2. Have permission:  webservice/rest:use 
  3. Be added to authorized users at :
    Site administration -> Server -> Web Services -> External Services - Ai Generation Service
  4. [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 PathHTTP MethodMoodle wsfunctionSummary / Description
/login/token.phpPOSTNoneAuthentication: Exchange a Moodle username and password for a valid wstoken.
/mod_minilesson_list_coursesGETmod_minilesson_list_coursesLists available Moodle courses including basic metadata and enrollment counts.
/mod_minilesson_aigen_list_templatesGETmod_minilesson_aigen_list_templatesRetrieves available AI generation activity templates, their required inputs, and expected outputs.
/mod_minilesson_aigen_list_minilessonsGETmod_minilesson_aigen_list_minilessonsLists all existing MiniLesson module instances located inside a specific course.
/mod_minilesson_aigen_create_empty_lessonPOSTmod_minilesson_aigen_create_empty_lessonProvisions a new, empty MiniLesson activity instance container inside a course section.
/mod_minilesson_aigen_create_add_items_to_lessonPOSTmod_minilesson_aigen_create_add_items_to_lessonDispatches an asynchronous background task to generate AI material and append it to a lesson. Returns a tracking jobid.
/mod_minilesson_aigen_fetch_create_items_statusPOSTmod_minilesson_aigen_fetch_create_items_statusPolls 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