moodle_download_file
Download a Moodle submission or assignment attachment to a local directory and get its saved file path. Existing files are preserved by appending a numbered suffix.
Instructions
Downloads a submission file (or an assignment attachment) to the local disk and returns its path. fileUrl is the url field from moodle_get_submission or moodle_list_assignments. An existing file is not overwritten: " (1)" is appended to the name.
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": {
"fileUrl": "<fileUrl>",
"destDir": "<destDir>"
},
"name": "moodle_download_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| destDir | Yes | Absolute path of the directory to save to; created if missing | |
| fileUrl | Yes | Moodle file URL (…/pluginfile.php/…) on this site |