paper
Search arXiv and other indexes, fetch and cache full texts, read sections, grep for answers, render figures, and record citations so coding agents retain prior-art decisions.
Instructions
Prior art you can actually read: arXiv search, full papers, page images.
WHEN TO USE: before building a non-trivial mechanism - caching, consensus, retry and idempotency, ranking, scheduling, rate limiting, a wire format. Anything where the naive version breaks at scale and a wrong choice costs a rebuild rather than a typo. AFTER THIS: read the paper rather than its abstract - read() by section, grep() for one question, render() for figures the text layer drops - then paper(action='remember') so the next agent finds the citation instead of re-deriving the decision.
The abstract is not the paper. Everything here is built to get past it: the whole text, cached once and served in slices, plus rendered pages for the figures and tables no text extractor recovers.
Sources are interchangeable. paper_id takes an arXiv id in any form (2401.12345v2, arXiv:2401.12345, an abs or pdf URL); url takes any http(s) PDF or a landing page that names one; path takes a local .pdf.
Actions: search query a literature index. Returns real metadata, abstracts truncated, because a search is for choosing what to read. source='arxiv' (default) is the arXiv API. 'alphaxiv' searches the full text of arXiv papers and returns the matching snippets; 'alphaxiv_semantic' is the same corpus by meaning rather than words. 'openalex' reaches journals and every discipline, and 'biorxiv' is OpenAlex limited to bioRxiv preprints. Each result says how to fetch it, or that no open PDF is known. fetch download, extract, and cache one paper. Returns the outline and page count so you know what to ask for next. Idempotent. read the cached text. mode='outline' (default) lists sections; mode='full' is the entire paper; mode='latex' reads the submission's original TeX, where section boundaries are declared rather than guessed and formulas are intact; mode='html' is arXiv's HTML rendering; mode='abstract' if you only want the pointer. pages='7-12' or section='4'/'method' narrow it. Long reads page via offset. A paper with no text layer (a scan) comes back as page images rather than as an empty string, so a read always answers. grep regex search inside the full text, with page-anchored context. Answers one question without reading the other thirty pages. Says so when the paper has no text layer, because zero hits there means 'not searchable', not 'not present'. render rasterise pages to PNG and return them as images. This is how you see a figure, a table, an architecture diagram, or a scanned PDF whose text layer is empty. Max 8 pages per call. figures extract embedded raster figures at their own resolution. Vector figures are not rasters; use render for those. download copy the PDF into any directory you name. list what is already cached. forget drop one paper from the cache. remember write what a paper settled into this repository's memory graph, anchored to the symbols and files it informed, so the next agent finds the citation instead of rediscovering it.
Args: action: one of the actions above. query: search text. Fielded arXiv syntax (ti:, au:, abs:, AND/OR) is passed through untouched; plain text is wrapped in all:"...". paper_id: an arXiv id, in any of the forms above. url: any http(s) PDF URL, or a landing page that names one. path: a local .pdf file. category: arXiv categories to restrict to, e.g. "cs.DC cs.DB". arXiv only. source: for search - arxiv | alphaxiv | alphaxiv_semantic | openalex | biorxiv. max_results: search hits to return, 1-100. sort: relevance | recent | updated, plus popular | historical for the non-arXiv sources. start: offset into the search results, for paging. mode: for read - outline | full | latex | html | abstract. pages: page selection like "3" or "7-12" or "1,4,9-11". Used by read, render, and figures. section: section number ("4", "4.2") or name ("method") for read. pattern: regex for grep. ignore_case: case-insensitive grep. Default true. context: characters of context around each grep hit. max_chars: cap on returned text per read call. 0 means no cap. offset: character offset into a read, for continuing a long one. dpi: render resolution, 50-400. Higher is sharper and much larger. dest: directory to download the PDF into. filename: override the generated filename for download. save_to: directory for rendered pages or extracted figures. refresh: re-download and re-extract even if cached. with_html: on fetch, also pull arXiv's HTML rendering if it exists. vision: on read, when the paper has no extractable text layer, return the requested pages as images instead of an empty string. On by default - a scanned paper is readable, just not as text. Set false if you want the empty result rather than the pixels. with_latex: on fetch, also pull the original TeX source. Pulled automatically when the PDF extracts poorly, which is the same set of old papers whose metadata the arXiv API tends to refuse. with_text: on download, write the extracted text alongside the PDF. limit: maximum rows for list. note: for remember - what this paper settled, in your own words. This is the memory's substance; without it only the citation is stored. symbols: for remember - symbols this paper informed, so the memory anchors to real code. files: for remember - files this paper informed. kind: for remember - rationale | decision | note | investigation. root: repository path, for remember. Defaults to the working directory.
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": "paper"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dpi | No | ||
| url | No | ||
| dest | No | ||
| kind | No | rationale | |
| mode | No | outline | |
| note | No | ||
| path | No | ||
| root | No | ||
| sort | No | relevance | |
| files | No | ||
| limit | No | ||
| pages | No | ||
| query | No | ||
| start | No | ||
| action | No | search | |
| offset | No | ||
| source | No | arxiv | |
| vision | No | ||
| context | No | ||
| pattern | No | ||
| refresh | No | ||
| save_to | No | ||
| section | No | ||
| symbols | No | ||
| category | No | ||
| filename | No | ||
| paper_id | No | ||
| max_chars | No | ||
| with_html | No | ||
| with_text | No | ||
| with_latex | No | ||
| ignore_case | No | ||
| max_results | No |