Skip to main content
Glama

Compile the project

compile_project
Read-only

Compile an Overleaf project locally with latexmk, report LaTeX errors and warnings before pushing changes, and catch broken papers early. Build artifacts stay outside the clone.

Instructions

Compile one project locally with latexmk -pdf and report the errors and warnings, so a broken paper is caught before collaborators see it. Call it after editing and before push_changes. 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 only the log comes back, never a PDF. 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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNoWhich project to use: its Overleaf address, its 24-character id, or a registered project name. Omit to use the default project.
mainTexFileNoPath to the root .tex file, the one containing \begin{document}. Omitted, the server guesses it from the project layout and says so if the guess has no document environment.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.8

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the readOnlyHint/openWorldHint annotations: halts at first error, build artifacts written outside the clone so they are never pushed, only the log is returned (never a PDF), missing latexmk/TeX is reported rather than silently failing, 180s default timeout reported as error, and sparse-checkout files are restored so figures exist on disk. This is unusually rich behavioral disclosure for a compile tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads purpose and sequencing before diving into fallbacks and environment caveats, and nearly every clause carries distinct information. It is a dense single paragraph that could be broken into structure, but little is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, and the description compensates by specifying what comes back (the log only, no PDF) and what a timeout or missing TeX distribution yields. With only two optional params, nothing an agent needs to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds real meaning the schema lacks: the ordered fallback list (main.tex, paper.tex, manuscript.tex, root.tex, thesis.tex, article.tex, then the shallowest .tex) and the failure condition when the guess has no \begin{document}.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and resource ('Compile one project locally with latexmk -pdf') plus the outcome ('report the errors and warnings'), and names the sibling it precedes (push_changes). An agent can distinguish it from sync_project, project_status, or edit tools without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit sequencing: 'Call it after editing and before push_changes,' and the scope exclusion 'It compiles the clone as it stands... without pulling' implicitly directs pull/sync work to sync_project. Both when-to-use and what it does not do are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.