Skip to main content
Glama

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

NameRequiredDescriptionDefault
draftNoDraft mode: images become boxes, for faster text-only builds
projectIdYesOverleaf project ID
timeoutMsNo
rootFilePathNoProject-relative path using forward slashes
stopOnFirstErrorNoStop at the first LaTeX error, for a short log

Output Schema

NameRequiredDescriptionDefault
statsYes
statusYes
buildIdNo
summaryYes
buildRefNo
outputFilesYes
clsiServerIdNo
rootFilePathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations, the description discloses important behavior: status "success" can still hide LaTeX errors, builtCleanly has specific conditions, summary counts all errors and warnings while listing only the first 20, outputFiles may omit stale .blg/.bbl files, and buildRef persists for later log access. It also documents rate-limit, timeout, and failure semantics with actionable recovery guidance.

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?

The content is dense and front-loaded with the key build and status semantics. However, it is delivered as one long paragraph, and the error-code and output-field details could be easier to scan if structured into shorter sections. Most sentences still earn their place.

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?

The tool has an output schema, so the description need not document every return field. It still covers the critical distinctions an agent needs: builtCleanly versus status, summary contents, outputFiles behavior, buildRef reuse, error codes, and compile-allowance implications. The definition is complete for correct invocation and interpretation.

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 80%, so the schema already provides descriptions for several parameters. The description adds meaningful semantics for rootFilePath, draft, and stopOnFirstError, including the web UI equivalence and short-log behavior. It does not explain timeoutMs beyond the schema constraints, so it falls short of a perfect score.

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?

The description states a specific verb and resource: compile a project and report on the build from its logs. It also distinguishes the operation from log retrieval and output download siblings by explaining that buildRef names the build for get_compile_log and download_compile_output.

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?

It gives explicit when-to-use guidance: omit rootFilePath to build the configured root document, or pass it to build a different document for this call only. It also tells the agent to check summary.builtCleanly rather than status, and to read the summary instead of recompiling to conserve compile allowance.

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