Skip to main content
Glama

Add a reference and cite it

add_reference
Destructive

Adds a published work (by DOI) to the project's references the way that document keeps them: an entry in the .bib file it uses, or a \bibitem in its thebibliography list placed in citation order. With cite_after, also inserts \cite{key} right after that exact text (it must occur once in the file), so the numbering comes out right. Returns the citation key.

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": {
      "project_id": "<project_id>",
      "doi": "<doi>"
    },
    "name": "add_reference"
  }
}

Input Schema

NameRequiredDescriptionDefault
doiYesThe work's DOI.
pathNoThe .tex file where the citation goes; the project's main file if omitted.
cite_afterNoExact text in that file after which to insert \cite{key}, e.g. the end of the sentence that cites it (before its full stop).
project_idYesThe project's id, from list_projects.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=false, and openWorldHint=true, so the safety profile is covered. The description still adds real value: it names exactly what gets modified (the .bib file or the thebibliography list, placed in citation order), states a failure precondition (the anchor text must occur exactly once), and discloses the return value. It does not discuss rollback or behavior if the bibliography file is absent.

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?

Two dense sentences that front-load the core action and the storage behavior, with the optional citation step and its constraint following. Slightly packed with parentheses and asides, but every clause carries information and 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 four-parameter mutation tool with no output schema, the description covers the write target, ordering semantics, the optional follow-on action with its precondition, and the return value (citation key). An agent has enough to call it correctly and anticipate the failure mode.

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 the baseline is 3; the description earns above that by adding a constraint not in the schema, namely that cite_after must match exactly once in the file. It also clarifies that path defaults to the project's main file and that cite_after targets the sentence end before the full stop.

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?

States a concrete verb and resource ('Adds a published work (by DOI) to the project's references') and further specializes by explaining the two storage mechanisms (.bib entry vs \bibitem) and the optional citation insertion. An agent can distinguish this from generic write_file/edit_file siblings without inspecting schemas.

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

Usage Guidelines3/5

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

Usage is implied by the domain: use this to cite a work rather than hand-editing the bibliography. The cite_after condition and its precondition are explained, but there is no explicit statement of when to prefer this over write_file or edit_file, and no exclusions.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources