download_compile_output
Save a build's compiled PDF or other output file, such as output.log or output.blg, to a local path, with optional build selection and overwrite control.
Instructions
Save a build's compiled PDF, or another output file such as output.log, output.blg, or output.synctex.gz, to a local path on the server's own disk, in one call. file defaults to output.pdf and must be a relative output path without "..". Without buildRef it uses the latest build compile_project made in this server process, else NO_BUILD; a file the build did not produce, an output.blg or output.bbl left over from an earlier build included, is NOT_FOUND, and an expired build is BUILD_NOT_FOUND. The folder must exist. An existing file is replaced only when overwrite is true, else CONFIRMATION_MISMATCH and nothing is downloaded; a replacement is atomic. A .pdf that does not start with %PDF- is PROTOCOL_UNSUPPORTED and nothing is written. Returns the absolute localPath, file, sizeBytes, buildId, and replaced.
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>",
"localPath": "<localPath>"
},
"name": "download_compile_output"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | Output file of the build; defaults to output.pdf | |
| buildRef | No | From compile_project; defaults to the latest build in this process | |
| localPath | Yes | Local file to write, for example paper.pdf | |
| overwrite | No | Replace localPath if it already exists | |
| projectId | Yes | Overleaf project ID |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | ||
| buildId | Yes | ||
| replaced | Yes | ||
| localPath | Yes | ||
| sizeBytes | Yes |