Skip to main content
Glama

Add a reference by DOI or arXiv id

references_add
Idempotent

Resolve a DOI, arXiv ID, or OpenAlex ID to a BibTeX entry and append it to a project .bib file, creating missing files. Returns the citation key for immediate \cite use.

Instructions

Resolve a DOI, doi.org URL, arXiv id, or OpenAlex id to a BibTeX entry and append it to a .bib file on the branch (default: references.bib next to the root file). A bibFile that does not exist is created, folders included (created:true in the result). Returns {key, bibFile, duplicate, created} — use \cite{key} right away; a note says when no .tex on the branch loads that .bib (\addbibresource or \bibliography), in which case the citation stays undefined until one does. Titles are not lookups: for a paper you only know by name, ask the user for its DOI or arXiv id. If the lookup budget is reached or the upstream service fails, tell the user — do not retry in a loop.

Input Schema

NameRequiredDescriptionDefault
queryYesA DOI (10.xxxx/…), doi.org URL, arXiv id (2301.12345 or arXiv:2301.12345), or OpenAlex id (W…).
branchNoBranch name (defaults to 'main'). Every result, error results included, echoes {branch, head} — head is the branch's current commit (after a write, the commit that write made). Pass the branch explicitly whenever you are not on main.
bibFileNoTarget .bib path relative to the project root. Defaults to references.bib beside the root file; a missing file (and its folders) is created.
projectNoProject id. Optional when the access token is scoped to exactly one project.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already give readOnly=false, idempotent=true, openWorld=true, destructive=false, and the description adds real context beyond them: missing .bib files and folders are created, duplicates are reported, and an undefined-citation warning appears when no .tex loads the .bib. It also surfaces external-service failure modes and rate/budget limits, which the annotations do not imply.

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?

Front-loaded with the action and resource, then returns, then caveats, then anti-patterns — a sensible order. It is dense with parentheticals but nearly every clause carries operational information; only the restatement of the bibFile default is redundant with the schema.

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?

With no output schema, the description carries the return-value burden and does so fully: {key, bibFile, duplicate, created} plus the `created:true` case and the undefined-citation note. For a mutating, network-dependent tool it covers success, side effects, and partial-failure behavior.

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 description coverage is 100%, so the baseline is 3. The description largely restates schema content (default references.bib beside the root file) but does add meaning for `query` by excluding titles, which is the real semantic constraint on that parameter.

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 specific verb chain — resolve a DOI/arXiv/OpenAlex identifier to a BibTeX entry and append it to a .bib file on a branch — and names the concrete artifact involved. No sibling tool does this (list_citations reads, this writes), so an agent can distinguish it immediately.

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

Usage Guidelines5/5

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

Explicitly bounds usage: titles are not lookups, so ask the user for a DOI/arXiv id; on lookup-budget exhaustion or upstream failure, tell the user rather than retry in a loop. These are concrete when/when-not rules plus a failure-handling policy that no schema field could convey.

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