Add a reference by DOI or arXiv id
references_addResolve 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
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | A DOI (10.xxxx/…), doi.org URL, arXiv id (2301.12345 or arXiv:2301.12345), or OpenAlex id (W…). | |
| branch | No | Branch 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. | |
| bibFile | No | Target .bib path relative to the project root. Defaults to references.bib beside the root file; a missing file (and its folders) is created. | |
| project | No | Project id. Optional when the access token is scoped to exactly one project. |