download_file
Download an Overleaf document or binary file to a specified local path, refusing to replace existing files unless overwrite is enabled.
Instructions
Download one Overleaf document or binary file to an explicit local path. Refuses to replace an existing local file unless overwrite is set. The local path is checked before anything is fetched: an existing file without overwrite, or a folder (or a link to one) at localPath, is INVALID_ARGUMENT, a missing parent folder is NOT_FOUND, and a folder that cannot be written is INVALID_ARGUMENT with details.errno. With overwrite, an existing file is replaced atomically, keeping its permissions, so its folder must be writable.
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": {
"projectId": "<projectId>",
"filePath": "<filePath>",
"localPath": "<localPath>"
},
"name": "download_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Project-relative path using forward slashes | |
| localPath | Yes | ||
| overwrite | No | Replace localPath if it already exists | |
| projectId | Yes | Overleaf project ID |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bytes | Yes | ||
| localPath | Yes |