Files
scientific-agent-skills/tests/paper-lookup/fixtures/arxiv_rate_limited.txt
Timothy Kassis 061882ba79 Update paper-lookup to 2.0
Audited every documented endpoint against the live APIs and fixed what
came back wrong, then added the tooling for the failures that cannot be
fixed by documentation alone.

These APIs report failure with HTTP 200, which is the theme running
through most of this change:

- PMC eFetch returns a well-formed article with no <body> for non-OA
  content, with the reason only in an XML comment that parsers discard.
  This is the common case, not an edge case: eFetch full text covers the
  ~3M OA Subset out of ~10M articles.
- arXiv returns totalResults 1 and a single entry titled "Error" for a
  malformed parameter, and silently rewrites an unknown field prefix to
  all:, so a typo degrades a targeted search into a full-text one.
- bioRxiv/medRxiv /details/ pages are 30 records, not the documented 100,
  and an out-of-step cursor is accepted with a 200 -- a step-by-100 walk
  skipped records 30-99 of every hundred while looking successful.
- Europe PMC puts errCode in a 200 body.

Documentation fixes:

- Corrected bioRxiv/medRxiv page size and documented the per-endpoint
  messages shape, including why total (360) and count_new_papers (232)
  differ and which endpoints expose no counts at all.
- Percent-encoded the arXiv date-range brackets; the previous example
  made curl exit 3 (bad range specification) before sending anything.
- Documented the PMC non-OA hazard and added the PMC OA Web Service,
  which answers "is full text actually available" before the fetch.
- Corrected <arxiv:doi>: it is the journal DOI and is absent for papers
  that were never published. A constructed 10.48550/arXiv.{id} resolves
  at doi.org but 404s in both Crossref and OpenAlex, so it is not a
  portable key.
- Corrected the arXiv <id> scheme: entry ids are http:// while the links
  to the same pages are https://, inconsistent within one response.
- Flagged the /publisher/ example, which returns "no articles found" for
  valid prefixes, and the api.medrxiv.org host, which 500s on paths that
  api.biorxiv.org serves.
- Replaced the cross-platform fetch-tool table with a curl-first section
  that matches what allowed-tools actually grants.
- Removed stray tool-call markup from the end of SKILL.md.

Europe PMC (references/europepmc.md) closes a real gap: bioRxiv and
medRxiv have no keyword search of their own, and Europe PMC indexes both.
Its fullTextXML also 404s honestly where eFetch returns a bodyless 200.

scripts/ (standard library only) covers the logic that was being
re-derived per query, each exiting non-zero on a silent failure:
paginate.py (4 = unexplained shortfall), jats_to_text.py (2 = no <body>),
arxiv_atom.py (3 = error feed, 5 = throttled), openalex_abstract.py.
paginate.py redacts credentials from the provenance URLs it emits, since
OpenAlex and Crossref authenticate by query string.

tests/paper-lookup/ has 79 tests over fixtures captured from real
responses. arxiv_error.xml is reconstructed from a verified response
rather than saved from one, and says so -- arXiv penalizes repeated
malformed requests and stayed throttled.
2026-07-27 18:32:30 -07:00

1 line
14 B
Plaintext