Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
OVERLEAF_PROJECTSNoComma-separated name=projectId pairs, e.g. paper=64a1b2c3d4e5f6a7b8c9d0e1
OVERLEAF_GIT_TOKENYesOverleaf Git authentication token, generated at https://www.overleaf.com/user/settings under Git integration
OVERLEAF_SESSION_COOKIENoOptional overleaf_session2 cookie; turns on the three tracked-changes tools
OVERLEAF_DEFAULT_PROJECTNoWhich registered project name to use when a tool call omits project

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_projectsA

List the Overleaf projects this server is configured to reach, marking which one is the default. Reads local configuration only, so it answers without contacting Overleaf and proves nothing about access. Call this when a request is ambiguous about which paper it means, or when another tool reports an unknown project. Returns one line per registered name, marked (default) where it applies and followed by its display name when one is configured. Any project not listed can still be reached by passing its Overleaf address as project.

read_fileA

Read one text file from the project after pulling the latest commits from Overleaf. Plain calls return the text, line-numbered when startLine or endLine is given; startLine alone reads to the end, and endLine is clamped to the file. mode=full returns JSON with the content and a revision hash for a guarded edit; mode=smart with previousRevision returns kind unchanged, a delta, or full content when this server process does not know that revision or a delta would be no smaller. Use a line range to sample a large file, mode=full before an edit that passes expectedRevision, and mode=smart to re-read a file already read. Apply a delta only to its exact baseline: split on newline, replace deleteLineCount lines at the 1-based startLine with change.lines, and join on newline. Plain text is cut off after 60,000 characters; in a revision mode, a file too large to return whole comes back truncated with no revision. Fails without reading for a missing or binary file, a path outside the project, a line range combined with mode, or startLine after endLine.

list_filesA

List every file in the project, grouped by kind (LaTeX sources, bibliographies, figures, other), after pulling the latest commits from Overleaf. Use it to find exact paths before reading or editing; use project_summary when counts are enough, and search_project to find which file mentions something. Files sparse checkout keeps off disk are listed too, since they are still part of the project. extension keeps only paths ending in that suffix, case-insensitively, and filters untracked files as well; includeUntracked adds files created locally that push_changes has not committed yet, marked (untracked). Returns the file count and the likely main document, then the paths under each kind. If the pull conflicts with unpushed local work, it fails, keeps that work, and says how to resolve it.

project_summaryA

Summarize one project in a single structured result (file counts by kind, the likely main document and its section count, pending local work) to orient at the start of a task. Use list_files for every path, list_sections for a document's outline, and project_status for commit-level sync state. mainFile is a guess: main.tex, paper.tex, manuscript.tex, root.tex, thesis.tex or article.tex at the root, otherwise the shallowest .tex file, so check it for \begin{document} before relying on it. Pulls from Overleaf first; if that pull conflicts with unpushed local work, it fails and keeps the work. project can name any project the default token reaches, registered or not; the first call on a project clones it, so it is slower than later calls.

list_sectionsA

List the sectioning commands in one .tex file, \part down to \subparagraph including starred forms, with their nesting depth and line ranges. Call it before read_section or edit_section to get the exact titles they match, and to address part of a paper by title instead of line numbers that shift with every edit. path names a single file: \input and \include are not followed, so list each included file separately, and commented-out headings are skipped. Pulls from Overleaf first. Returns one line per heading, indented by depth, as \section{Title} [lines start-end], or says the file has none; a missing, binary or out-of-project path fails.

read_sectionA

Read one section of a .tex file by its title: from its heading to the next heading at the same or a shallower level, stopping before trailing matter such as \appendix, the bibliography or \end{document}. Prefer it over read_file when revising one part of a paper, so the rest stays out of context. sectionTitle is compared case-insensitively with the title in braces, not an optional [short] title: an exact match wins, otherwise the first heading in document order that contains it, so a short fragment can pick an earlier section than intended. Pulls from Overleaf first. Returns the section's LaTeX source as stored, cut off after 60,000 characters; if nothing matches, the reply lists the titles that exist.

search_projectA

Search the project's text sources for a literal string or a regular expression, returning matching lines as path:line: text. Use it to find where a term, citation key, label or command appears when you do not know which file holds it; once you do, use read_file or read_section, and use list_files to find a file by name. Only .tex, .ltx, .bib, .cls, .sty, .bst, .txt and .md files are searched, and a file created locally is not searched until push_changes commits it. Both modes are case-insensitive and match one line at a time, so a pattern cannot span lines. A regular expression uses JavaScript syntax, sees the first 4,000 characters of each line, and is abandoned with an error after 10 seconds; an invalid one fails with its syntax error. maximumMatches counts matching lines, taken in path order. Pulls from Overleaf first.

replace_textA

Replace an exact snippet of text in a project file. Prefer it over write_file and edit_section for a targeted change: nothing outside the snippet is touched. findText must match exactly, whitespace and newlines included, and occur once unless replaceAll is set; replaceWith is inserted literally, so $$, $& and $1 stay as written. If the snippet is missing, or occurs several times without replaceAll, nothing changes and the reply gives the count; widen findText with surrounding text to make it unique. Pulls from Overleaf first, then edits only the local clone; push_changes publishes it. Returns how many occurrences were replaced.

edit_sectionA

Replace one whole section of a .tex file, located by its title. Use replace_text for a smaller change and this to rewrite a section wholesale. The section runs from its heading to the next heading of the same or a shallower level, never swallowing trailing matter such as \end{document} or the bibliography. newContent replaces that range line for line, so it must start with the \section{...} command itself or the heading is lost, and should end with a newline to keep the blank line before the next heading. sectionTitle is compared case-insensitively with the title in braces: an exact match wins, otherwise the first heading in document order that contains it. Pulls from Overleaf first, then edits only the local clone; push_changes publishes it. Returns the heading replaced and its former line range; if no title matches, nothing changes and the reply lists the titles.

write_fileA

Write a whole file: create it, with any missing parent directories, or overwrite it entirely. Use it to add a new file; for an existing one prefer replace_text or edit_section, which cannot drop text you did not mean to rewrite. content is written exactly as given, as UTF-8, with no trailing newline added. expectedRevision makes the call a guarded overwrite, refused if the file changed since that read or no longer exists, so leave it out when creating a file. path must be relative and stay inside the project; absolute paths, .. escapes and the .git directory are refused. Pulls from Overleaf first, then writes only the local clone; push_changes publishes it. Returns whether the file was created or overwritten.

show_diffA

Show a unified diff of everything in one project's clone that Overleaf does not have yet: uncommitted edits, new and deleted files, and commits left behind by a refused push. Call it before push_changes to see exactly what collaborators will receive, and after a refused push to inspect what is still pending; use project_status when counts are enough. It does not pull first, so the comparison is against Overleaf as last fetched; it contacts Overleaf only to clone a project not opened before. Covers only the chosen project. The diff is cut off after 60,000 characters, and "No local changes pending." means there is nothing to push.

discard_local_changesA

Permanently throw away every local edit, new file and unpushed commit in one project's clone, fetching Overleaf first so the clone ends up matching its current version. The discarded work cannot be recovered from this server. Call show_diff first, and only call this once the user has said the work should be abandoned. Its main use is after push_changes refuses a conflicting change: the clone cannot be pushed again until the conflicting local commits are either published or discarded here. Only the chosen project is reset; pending work in other projects is untouched. Returns how many edited files and unpushed commits were discarded, or that there was nothing to discard.

delete_fileA

Delete a file from the project. The file is removed from the local clone only: it stays in Overleaf, and co-authors keep seeing it, until push_changes publishes the removal. Until then discard_local_changes brings it back, and show_diff shows the pending deletion. Deleting a file a co-author still cites or includes will break their compile, so confirm it is unused first with search_project on its path or label. To replace a file's contents instead, use write_file. path is relative to the project root, as list_files prints it; a directory is refused, and a file sparse checkout keeps off disk is still deleted from the project. Pulls from Overleaf first. Returns a confirmation, or says the path is not in the project and deletes nothing.

move_fileA

Move or rename a file inside one project, creating any missing parent directories. The move happens in the local clone only; nothing changes in Overleaf until push_changes. LaTeX references are not rewritten: an \input, \include or \includegraphics naming the old path will break, so search_project for it afterwards and fix the references with replace_text before pushing. Both paths are relative to the same project's root; to move a text file between projects, read_file it from one and write_file it into the other. Pulls from Overleaf first. If fromPath is not a file in the project or a file already exists at toPath, nothing moves and the reply says why.

project_statusA

Report where one project's local clone stands against Overleaf: branch and head commit, commits just pulled, commits still unmerged, local commits waiting to be pushed, files edited but not committed, and the last ten commits. Call it to learn whether there is anything to push or anything new from a collaborator; use show_diff to read the pending edits themselves. It pulls as part of answering, and that pull only updates the local clone: nothing changes on Overleaf and no local edit is dropped. A conflicting pull does not fail the call; the reply adds a WARNING with the conflict and the clone is left as it was. For a project not opened before, the clone is made first, so that first report shows nothing pulled. Returns plain name: value lines.

sync_projectA

Pull the latest commits from Overleaf into one project's local clone. Nothing is sent to Overleaf and no local edit is discarded. The read tools pull on their own, so this is rarely needed first; call it to check explicitly that the clone is current, or after a collaborator says they have pushed. Use project_status for the full picture. If the pull cannot complete cleanly it fails and leaves local work untouched, rather than resolving the conflict on its own. Only the chosen project is pulled; a project not opened before is cloned instead, and reports nothing pulled. Returns how many commits were pulled and how many local commits are still unpushed.

compile_projectA

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.

push_changesA

Publish every pending local edit to Overleaf as one commit. This is the only tool that changes the project collaborators see, and the change is immediate and public. Call show_diff first, and compile_project when the edit could break the build. Before pushing, the server re-checks Overleaf and rebases onto whatever collaborators pushed in the meantime. If two edits touch the same lines the push is refused, both versions are reported, and no local work is lost: nothing is overwritten and no winner is chosen. commitMessage labels the one commit made from the pending edits; commits already waiting from an earlier refused push keep their own messages and go out with it. Only the chosen project is pushed. Returns the new commit hash and the diff that was published, or reports that there was nothing to push.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.4/5.0

Scored across 18 tools

Disambiguation4/5

Each tool has a distinct resource+action, and descriptions explicitly cross-reference alternatives (e.g. list_files vs project_summary vs search_project, read_file vs read_section). Some mild overlap exists between read_file/read_section and show_diff/project_status/sync_project, but the descriptions resolve the boundaries clearly.

Naming Consistency4/5

Nearly all tools follow a verb_noun or verb pattern (read_file, list_files, edit_section, push_changes, compile_project). The only deviations are the noun_noun pair project_summary and project_status, which are still readable and predictable.

Tool Count4/5

18 tools is slightly on the heavy side but each earns its place across the read/edit/sync/compile/publish lifecycle of a real Overleaf client. No obvious redundant tools inflate the count.

Completeness4/5

The surface covers the full editing lifecycle: discovery, read, search, edit, write, move, delete, diff, status, sync, compile, and push. Minor gaps remain (project creation, history/versioning, PDF export, collaborator management), but core workflows have no dead ends.

Maintenance

ActivityNo data
ResponsivenessNo issues