check_references
Finds broken cross-references and citations in an Overleaf LaTeX project without compiling, reporting undefined keys, unused labels and bibliography entries, duplicate labels, and unresolved files.
Instructions
Find broken cross-references and citations without compiling. Walks the manuscript from rootFilePath, or the project's root document, through its include directives as get_full_document does, and reads the .bib files named by \bibliography (.bib added) or \addbibresource, resolved from the project root, uploaded or linked ones (from a reference manager) included. It collects \label keys; the keys of \ref, \eqref, \pageref, \autoref, \nameref, \cref, \Cref, \vref, and their relatives, comma-separated lists split; and the keys of \cite and the natbib and biblatex citation commands, checked against .bib entries and \bibitem keys. Returns rootFilePath; undefinedReferences and undefinedCitations, each use of a key nothing defines (undefinedCitations is empty and citationsChecked false when a named bibliography could not be read); unusedLabels, labels nothing refers to; unusedBibEntries, entries nothing cites (none when \nocite{*} is used); duplicateLabels, every definition of a key defined more than once; each a list of { key, filePath, line } (1-based), at most 500 per list, with truncated true when one was cut; filesRead; and unresolved, as get_full_document reports it, plus bibliography files that are missing (missing) or named by a macro (macro_argument). It reads source text, not TeX: % comments and verbatim text are skipped, but keys built by macros, labels defined inside custom commands or packages, cross-document references, and conditionals are not understood, so a result is a prompt to look, not proof. A compile remains the authority. Errors are those of get_full_document.
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": "check_references"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Overleaf project ID | |
| rootFilePath | No | Document to start from; defaults to the root document configured in Overleaf |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filesRead | Yes | ||
| truncated | Yes | ||
| unresolved | Yes | ||
| rootFilePath | Yes | ||
| unusedLabels | Yes | ||
| duplicateLabels | Yes | ||
| citationsChecked | Yes | ||
| unusedBibEntries | Yes | ||
| undefinedCitations | Yes | ||
| undefinedReferences | Yes |