Skip to main content
Glama

Check references, citations and included files

check_references
Read-only

Checks LaTeX cross-references and citations from source without compiling, flagging missing labels, unmatched cite keys, duplicate definitions, and missing included or bibliography files.

Instructions

Check a LaTeX document's cross-references and citations from its source, without compiling: \ref, \eqref, \cref and similar with no matching \label; \cite keys found in no .bib file or \bibitem; labels and bibliography keys defined twice; and \input, \include, \includegraphics and bibliography files that do not exist. Use it before push_changes or a compile, and after renaming a label, a citation key or a figure. It starts at the main document and follows \input, \include, \subfile and \import, so a .tex file the document never includes is listed, not checked. Comments and verbatim blocks are ignored, and a path or key built from a macro is counted rather than guessed. Pulls from Overleaf first. Returns a verdict line with the number of problems, each problem with its file and line, then labels never referenced and bibliography entries never cited, which are worth a look but are not errors.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "check_references"
  }
}

Input Schema

NameRequiredDescriptionDefault
projectNoWhich project to use: its Overleaf address, its 24-character id, or a registered project name. Omit to use the default project.
mainTexFileNoRoot document to start from, as a path in the project, e.g. main.tex. Omit to use the likely main document, the same guess project_summary makes.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.0

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the readOnlyHint/openWorldHint annotations, it discloses substantial behavior: it resolves the document graph by following \input, \include, \subfile and \import from the main file; it ignores comments and verbatim blocks; macro-built paths and keys are counted rather than guessed; and it "pulls from Overleaf first," telling the agent a network call and refresh may occur. It even describes the return payload (verdict line, per-problem file and line, then unreferenced labels and uncited bib entries flagged as non-errors).

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 purpose and the check list are front-loaded, and the paragraph is dense but largely waste-free — each clause adds a distinct fact (check types, lifecycle timing, graph traversal, comment handling, macro conservative behavior, output shape). A single long paragraph carrying that many facts is slightly heavy, but nothing is redundant.

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 two-parameter read-only diagnostic with no output schema, the description covers everything an agent needs: what is checked, what is out of scope, when to run it, how the document graph is resolved, and what the response contains including the distinction between errors and advisory never-referenced labels. The absence of an output schema is fully compensated.

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

Parameters3/5

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

Schema coverage is 100%, so both parameters (project, mainTexFile) are already documented, and the description adds only indirect meaning — that checking starts at the main document and follows includes, and that data comes from Overleaf first. It does not clarify how project selection interacts with the default or how mainTexFile's fallback guess behaves beyond what the schema states, so this sits at the baseline.

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 opens with a specific verb and resource ("Check a LaTeX document's cross-references and citations from its source, without compiling") and then enumerates the exact defect classes: unmatched \ref/\cref, unresolved \cite keys, duplicate labels, missing \input/\includegraphics targets. An agent can distinguish this from list_files or compile_project purely from the text, and the phrase "without compiling" clarifies it is static analysis rather than a build.

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?

It gives concrete triggers: "Use it before push_changes or a compile, and after renaming a label, a citation key or a figure," naming actual sibling tools in the workflow. It also sets a scope boundary (files never included by the main document are listed, not checked). No explicit when-not-to-use case or named alternative for pure citation checking is given, so it stops short of a 5.

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