enrol_csv
Batch-enrol users from a CSV into a Moodle course, creating missing users with temporary passwords and showing status per row.
Instructions
Batch-enrol users in a course from a CSV (email,firstname,lastname[,role]). Creates missing users by default with a random temp password. Returns per-row status.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"course_id": "<course_id>",
"csv_content": "<csv_content>"
},
"name": "enrol_csv"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| course_id | Yes | ||
| csv_content | Yes | CSV with headers email,firstname,lastname[,role]. role defaults to student. | |
| default_role_shortname | No | student | |
| create_users_if_missing | No | If true, unknown emails trigger a user creation with a random temp password. |