Add ADS tools for astrophysics paper and link discovery#68
Open
pushwithak wants to merge 1 commit intoNASA-IMPACT:developfrom
Open
Add ADS tools for astrophysics paper and link discovery#68pushwithak wants to merge 1 commit intoNASA-IMPACT:developfrom
pushwithak wants to merge 1 commit intoNASA-IMPACT:developfrom
Conversation
Author
1 similar comment
Author
NISH1001
requested changes
Apr 20, 2026
NISH1001
requested changes
Apr 22, 2026
Comment on lines
+71
to
+73
| def _is_retryable_status(response: httpx.Response) -> bool: | ||
| """Return True if the response status code is retryable.""" | ||
| return response.status_code in _RETRY_STATUS |
Collaborator
There was a problem hiding this comment.
This can be a lambda function tiself probably.
| @retry( | ||
| retry=retry_any( | ||
| retry_if_exception_type((httpx.ConnectError, httpx.ReadError, httpx.RemoteProtocolError)), | ||
| retry_if_result(_is_retryable_status), |
Collaborator
There was a problem hiding this comment.
maybe just lambda is okay to have here
Collaborator
There was a problem hiding this comment.
the helpers might need a little bit of rework probably. Just wanted to make sure we're not introducing any claude-bloat to things that might not needed
NISH1001
requested changes
Apr 23, 2026
Collaborator
NISH1001
left a comment
There was a problem hiding this comment.
@pushwithak let's simplify this and no helper. Avoid any complicated retry etc
8edde37 to
4219a4c
Compare
Two MCP tools wrapping Astrophysics Data System API: - ADSSearchTool: search the literature for papers matching a query. Returns bibcode, title, authors, abstract, citation_count, DOI, publication, and names of linked data archives (HEASARC, MAST, Chandra, etc.). - ADSLinksResolverTool: given an ADS bibcode, return its "associated" bibcodes — the records ADS shows under "Described in" on the record page. For ASCL record bibcodes, the associated bibcodes are the code's canonical method papers, which is the authoritative source for canonical-paper recovery (ASCL's own described_in is often incomplete). Shared ADSToolConfig (base_url, api_token, timeout). Per-request httpx clients, errors returned via output.error, no retry logic — matches the pattern of sde_search and the eie tools. Requires ADS_API_TOKEN env var.
4219a4c to
eb7a806
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two MCP tools wrapping Astrophysics Data System (ADS) API for astrophysics paper discovery and citation-evidence retrieval.
Tools
ADSSearchToolSearch the ADS literature index. Input: a query (Solr syntax supported),
rowscap, optionalfqfilter. Output: papers with bibcode, title, authors, abstract, citation_count, DOI, publication, and names of linked data archives (HEASARC, MAST, Chandra, XMM, etc.).ADSLinksResolverToolGiven an ADS bibcode, return its "associated" bibcodes — the same records ADS shows under "Described in" on the record page. For ASCL record bibcodes (e.g.
2010ascl.soft10082F), the associated bibcodes are the code's canonical method/description papers.This tool exists specifically for canonical-paper recovery. ASCL's own
described_infield is often incomplete: the FLASH ASCL record lists only the 2005 update paper (~14 citations) and misses the canonical Fryxell+ 2000 paper (~2100 citations). The ADS resolver is the only reliable way to recover the canonical paper programmatically.Design
ADSToolConfig(base_url, api_token, timeout) — both tools hit the same API.httpx.AsyncClientoutput.errorinstead of raising, so agents can report failures without crashing the pipeline.Environment
ADS_API_TOKENrequired. Get a token at https://ui.adsabs.harvard.edu/user/settings/tokenTesting
tests/tools/test_ads.py— 10 integration tests against the live ADS API (module-level skip whenADS_API_TOKENis unset).