Compile the project
compile_projectCompile an Overleaf project locally or on Overleaf and report errors and warnings, helping catch broken papers before collaborators see them.
Instructions
Compile one project and report the errors and warnings, so a broken paper is caught before collaborators see it; where picks the compiler. Call it after editing and before push_changes. local, the default, runs latexmk -pdf on this computer. It compiles the clone as it stands, local edits included, without pulling, and halts at the first error. Without mainTexFile it tries main.tex, paper.tex, manuscript.tex, root.tex, thesis.tex and article.tex at the root, then the shallowest .tex file, and stops with a message if that file has no \begin{document}. Build artifacts go to a directory outside the clone, so they are never pushed, and the reply gives the path of the PDF there when the compile produced one, with the SyncTeX map beside it (latexmk runs with -synctex=1). Without latexmk and a TeX distribution installed locally it says so instead of compiling; a run past the configured timeout, 180 seconds by default, is reported as an error. It also restores any files sparse checkout was holding back, since figures must be on disk to compile. overleaf compiles on Overleaf's own servers, exactly as the Recompile button does, with the project's compiler and TeX Live version from Overleaf's settings and the account's plan deciding the time limit. It compiles what is in Overleaf now, so local edits count only after push_changes, and without mainTexFile it uses the main document set in Overleaf's menu; draft and stopOnFirstError apply to it only. Its PDF, log, output.bbl, output.blg and SyncTeX map, whichever it produced, are saved to the same build directory, replacing the previous compile's, and the reply gives each path. Returns a verdict line, then errors, then warnings, including BibTeX's and biber's for overleaf, then the output paths.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "compile_project"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| draft | No | where overleaf only. Draft mode: faster, with images replaced by boxes (default false). | |
| where | No | Where to compile (default "local"): local runs latexmk on the clone, local edits included; overleaf compiles on Overleaf's servers what has been pushed. | local |
| project | No | Which project to use: its Overleaf address, its 24-character id, or a registered project name. Omit to use the default project. | |
| mainTexFile | No | Root document to compile, as a path in the project, the one containing \begin{document}. Omitted, local guesses it from the project layout and says so if the guess has no document environment, and overleaf uses the main document set in Overleaf's menu. | |
| stopOnFirstError | No | where overleaf only. Stop at the first LaTeX error instead of carrying on to produce a PDF (default false, as in Overleaf). |