Skip to main content
Glama
prtc
by prtc

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
NameRequiredDescriptionDefault
bibcodeYesADS bibcode (e.g., '2019ApJ...878...98S')

Implementation Reference

  • 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)}"
            )]
  • 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"],
        },
    ),
  • 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"],
    },
  • 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"])

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/prtc/nasa-ads-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server