create_course
Create a Moodle course with a unique idnumber to avoid conflicts, with configurable format, visibility, and section count.
Instructions
Create a new Moodle course with a stable idnumber. Throws MOODLE_WS_COURSE_EXISTS if the idnumber is already in use. Default: hidden (visible=false), topics format, 10 sections.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | Course language code (e.g. "en", "pt", "pt_br"). The corresponding language pack MUST be installed on the Moodle server (Site administration > Language > Language packs), otherwise Moodle rejects the course creation. | |
| format | No | topics | |
| summary | No | ||
| visible | No | ||
| fullname | Yes | ||
| shortname | Yes | ||
| categoryid | No | ||
| numsections | No | ||
| idnumber_slug | Yes | Stable slug used to build the course idnumber (e.g. "ai-fundamentals-2026") |