Skip to main content
Glama

check_references

Read-only

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

NameRequiredDescriptionDefault
projectIdYesOverleaf project ID
rootFilePathNoDocument to start from; defaults to the root document configured in Overleaf

Output Schema

NameRequiredDescriptionDefault
filesReadYes
truncatedYes
unresolvedYes
rootFilePathYes
unusedLabelsYes
duplicateLabelsYes
citationsCheckedYes
unusedBibEntriesYes
undefinedCitationsYes
undefinedReferencesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.4.1

TDQS

A4.5/5.0
Behavior5/5

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

With only readOnlyHint=true supplied, the description carries substantial extra context: the 500-per-list truncation with truncated flag, the undefinedCitations empty/citationsChecked false case, the \nocite{*} suppression of unusedBibEntries, and the precise static-analysis limits (comments, verbatim, macros, conditionals, cross-document refs not understood). It explicitly frames output as "a prompt to look, not proof."

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

Conciseness3/5

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

The purpose is front-loaded, but the body is one dense, semicolon-chained paragraph packing parsing rules, output fields, and caveats together. Nearly every clause is substantive, yet the lack of sentence breaks or grouping makes it harder to scan than it needs to be.

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?

For a static-analysis tool with non-obvious limits, the description covers inputs, traversal, what is and is not parsed, every returned list, truncation, and error provenance. Even though an output schema exists, the caveats and edge cases go well beyond what a schema could convey.

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 both parameters are already documented. The description still adds meaning by explaining that rootFilePath is the starting point for walking include directives as get_full_document does, and that it falls back to the project's root document, which clarifies the semantics of the traversal.

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: "Find broken cross-references and citations without compiling." It names the exact classes checked (labels, refs, citations, bib entries) and implicitly distinguishes itself from compile_project by noting "A compile remains the authority."

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

Usage Guidelines4/5

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

Clear context: this is a static pre-compile check, and a real compile remains authoritative, which tells the agent when to trust it and when not to. It also anchors its traversal behavior to get_full_document. It does not, however, explicitly say when to prefer get_full_document or compile_project instead.

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