get_paper_details
Retrieve comprehensive metadata for astronomical papers from NASA ADS using bibcodes, including abstracts, authors, citations, and keywords.
Instructions
Get detailed information about a specific paper using its bibcode. Returns full metadata including abstract, authors, citations, keywords, and more.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bibcode | Yes | ADS bibcode (e.g., '2019ApJ...878...98S') |
Implementation Reference
- src/nasa_ads_mcp/server.py:368-415 (handler)The handler function that implements the core logic for retrieving detailed paper information using the ADS API, formatting title, authors, abstract, keywords, etc.async def get_paper_details(bibcode: str) -> list[TextContent]: """Get detailed information about a specific paper.""" try: papers = list(ads.SearchQuery( bibcode=bibcode, fl=["bibcode", "title", "author", "year", "citation_count", "abstract", "keyword", "doi", "pubdate", "pub"], )) if not papers: return [TextContent( type="text", text=f"Paper not found: {bibcode}" )] paper = papers[0] # Format authors authors = paper.author if paper.author else ["Unknown"] author_str = "; ".join(authors) # Format keywords keywords = ", ".join(paper.keyword) if paper.keyword else "None" # Build detailed response details = [ f"Title: {paper.title[0] if paper.title else 'No title'}", f"Authors: {author_str}", f"Publication: {paper.pub or 'Unknown'}", f"Year: {paper.year}", f"Citations: {paper.citation_count or 0}", f"DOI: {paper.doi[0] if paper.doi else 'N/A'}", f"Keywords: {keywords}", f"Bibcode: {paper.bibcode}", "", "Abstract:", paper.abstract or "No abstract available", ] return [TextContent(type="text", text="\n".join(details))] except Exception as e: logger.error(f"Error getting paper details: {e}") return [TextContent( type="text", text=f"Error getting paper details: {str(e)}" )]
- src/nasa_ads_mcp/server.py:78-94 (registration)The tool registration in list_tools(), defining the tool name, description, and input schema.Tool( name="get_paper_details", description=( "Get detailed information about a specific paper using its bibcode. " "Returns full metadata including abstract, authors, citations, keywords, and more." ), inputSchema={ "type": "object", "properties": { "bibcode": { "type": "string", "description": "ADS bibcode (e.g., '2019ApJ...878...98S')", }, }, "required": ["bibcode"], }, ),
- src/nasa_ads_mcp/server.py:84-93 (schema)Input schema defining the required 'bibcode' parameter as a string.inputSchema={ "type": "object", "properties": { "bibcode": { "type": "string", "description": "ADS bibcode (e.g., '2019ApJ...878...98S')", }, }, "required": ["bibcode"], },
- src/nasa_ads_mcp/server.py:272-273 (handler)Dispatch logic in the main call_tool handler that routes to the get_paper_details function.elif name == "get_paper_details": return await get_paper_details(bibcode=arguments["bibcode"])