download_file
Download a Moodle file from a pluginfile URL to a local path, creating the target directory if missing.
Instructions
Download a Moodle file (from get_course_contents) to a local path.
The Moodle token is appended automatically. The target directory is created if missing.
Args:
file_url: pluginfile.php URL from a module's contents[].fileurl
save_path: absolute local path to write the file to
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": {
"file_url": "<file_url>",
"save_path": "<save_path>"
},
"name": "download_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_url | Yes | ||
| save_path | Yes |