Skip to content

Fall back to public metadata for papers outside the catalog - #27

Merged
NielsRogge merged 2 commits into
mainfrom
claude/mcp-lookup-fallbacks
Oct 14, 2026
Merged

NielsRogge merged 2 commits into
mainfrom
claude/mcp-lookup-fallbacks

Conversation

@NielsRogge

Copy link
Copy Markdown
Collaborator

Production chat audit (7 days to 2026-10-14, ~5,500 turns): reliability is fine, but 5.7% of tool calls errored, mostly with lookups the agent could not recover from. This PR changes the MCP tools (and one CLI hint helper) so those calls return something useful.

Changes

  • Catalog misses fall back to public metadata. get_paper_info, read_paper, and get_related_papers used to return a bare not_found for arXiv IDs, arXiv/HF URLs, DOIs, and titles the catalog does not hold (76 of 80 recent misses were real catalog gaps). They now fetch public metadata: title, authors, abstract, date, links, and linked repos.
    • Sources, in order: Hugging Face Papers, then the arXiv abstract page. Titles try the arXiv API after HF Papers search. DOIs go to Crossref.
    • get_paper_info and read_paper mark the result in_catalog: false; read_paper returns the abstract as Markdown.
    • get_related_papers returns a catalog search for the public title, with a note.
    • A DOI whose public title (or arXiv ID) is in the catalog returns the catalog paper.
    • Lookups are best effort (6 s timeout per request) and cached for an hour, misses included. The reference is never logged.
    • When nothing matches, the error now says the paper is not in the catalog and no public record matched it.
  • Short names resolve. Title lookup accepts the one catalog paper whose title starts with the name before the colon: MuseTalk → MuseTalk: Real-Time High-Fidelity Video Dubbing … (2410.10122).
  • read_paper placeholder cursors. cursor="next" (and start, 0, …) with nothing saved now reads from the beginning. This caused 28 failures a week, each followed by identical retries.
  • Closest-result hints need real overlap. A hint now has to share at least half of the reference's words, contain or be contained in it, or be a near spelling (ratio ≥ 0.8). FaceNet no longer suggests WaveNet, and "person re-identification" no longer suggests Spoken Language Identification. No hint beats a misleading one.
  • get_benchmark with an unknown metric (overall, pass@1, accuracy on a leaderboard without them) returns the unfiltered leaderboard. A metric_note names the metrics it does have, instead of raising an error.
  • Bumps pwc-cli to 0.4.5 and pwc-mcp to 0.2.6.

Notes

  • New outbound traffic: a catalog miss now sends the user's paper reference to huggingface.co, arxiv.org, or api.crossref.org.
  • New output fields, all additive: PaperInfoResult.in_catalog/note, PaperReadResult.in_catalog, PaperPage.note, BenchmarkResult.metric_note.
  • arXiv's export API is rate-limited from the production host, so it is only the last resort for titles. Lookups by arXiv ID use the abstract page instead.

Verification

  • uv run pytest in mcp_server: 86 passed. Covers fallback, cursor, metric-note, short-name, caching, and parser tests.
  • CLI tests: 90 passed.
  • In-process live smoke run against the production API:
    • MuseTalk and Noise2Noise resolve in the catalog.
    • "Instant Neural Graphics Primitives with a Multiresolution Hash Encoding" returns arXiv metadata (2201.05989) with in_catalog: false.
    • https://doi.org/10.1088/1361-6471/ac5fb4 resolves to catalog paper 2108.05103 through its Crossref title.
    • read_paper(cursor="next") reads from the beginning.
    • get_method("FaceNet") and get_task("person re-identification") return no misleading hints.
    • get_benchmark("ImageNet", sort_metric="pass@1") returns the leaderboard with "available metrics: FID, PSNR, SSIM".

Chat-related: do not merge or deploy without explicit authorization.

🤖 Generated with Claude Code

NielsRogge and others added 2 commits October 14, 2026 07:24
Production chat (7 days to 2026-10-14, ~5,500 turns) showed 5.7% tool
errors, mostly lookups the agent could not recover from:

- get_paper_info, read_paper, and get_related_papers returned a bare
  not_found for arXiv IDs, arXiv URLs, DOIs, and titles the catalog does
  not hold (76/80 recent misses were real catalog gaps). They now fall back
  to public Hugging Face Papers, arXiv abstract-page/API, or Crossref (DOI)
  metadata: title, authors, abstract, date, links, and linked repositories,
  marked in_catalog=false (read_paper returns the abstract as Markdown;
  get_related_papers returns a catalog search for the public title with a
  note). A DOI whose public title is in the catalog returns the catalog
  paper. Lookups are best effort, cached for an hour including misses, and
  never logged with the reference.
- Title lookup resolves a unique short name before a title's colon, so
  "MuseTalk" finds "MuseTalk: Real-Time High-Fidelity Video Dubbing ...".
- read_paper treats placeholder cursors such as "next" (28 failures a
  week, then identical retries) as reading from the beginning.
- Closest-result hints for task/method/benchmark misses now require half
  the reference's words, containment, or a near spelling, so FaceNet no
  longer suggests WaveNet and "person re-identification" no longer suggests
  Spoken Language Identification.
- get_benchmark answers a metric the leaderboard does not report
  ("overall", "pass@1") with the unfiltered leaderboard and a metric_note
  naming the available metrics, instead of an error.

Bumps pwc-cli to 0.4.5 and pwc-mcp to 0.2.6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NielsRogge
NielsRogge merged commit 6762aef into main Oct 14, 2026
2 checks passed
@NielsRogge
NielsRogge deleted the claude/mcp-lookup-fallbacks branch October 14, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant