compile_project
Compiles an Overleaf LaTeX project and reports build logs, errors, warnings, and PDF details so you can verify a clean build without recompiling.
Instructions
Compile a project and report on the build from its logs. Omit rootFilePath to build the root document configured in Overleaf, which is what the web UI's Recompile button uses; pass it to build a different document for this call only. Check summary.builtCleanly, not status: Overleaf reports status "success" whenever a PDF came out, even when LaTeX hit errors along the way. builtCleanly is true only when a PDF was produced, output.log was read, and it reports no error. summary lists the first 20 errors and warnings as { file?, line?, message } (errorCount and warningCount count all of them), undefined references and citations, missing files, pageCount, and pdfSizeBytes; messages never quote the document. A LaTeX error that stopped the build returns status "failure" with the same summary rather than an error. outputFiles is Overleaf's listing, less an output.blg and output.bbl left over from an earlier build when BibTeX did not run for this one. buildRef names this build to get_compile_log and download_compile_output, also in a later process. stopOnFirstError gives a short log holding the one error that matters; draft skips images for faster text-only builds. Compiles spend the account's compile allowance, so read the summary instead of recompiling. Errors: COMPILE_RATE_LIMITED (Overleaf ran nothing; wait details.retryAfterMs when given, then compile once more), COMPILE_UNAVAILABLE (try later), COMPILE_TIMEOUT (the build hit the time limit; details.buildRef, when present, reaches its partial log), COMPILE_FAILED (no build to report on), and TIMEOUT (the request timed out while Overleaf may still be compiling; it is not retried).
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>"
},
"name": "compile_project"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| draft | No | Draft mode: images become boxes, for faster text-only builds | |
| projectId | Yes | Overleaf project ID | |
| timeoutMs | No | ||
| rootFilePath | No | Project-relative path using forward slashes | |
| stopOnFirstError | No | Stop at the first LaTeX error, for a short log |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stats | Yes | ||
| status | Yes | ||
| buildId | No | ||
| summary | Yes | ||
| buildRef | No | ||
| outputFiles | Yes | ||
| clsiServerId | No | ||
| rootFilePath | Yes |