Skip to main content
Glama
prtc
by prtc

get_library_papers

Retrieve all papers from a NASA ADS library to access paper details in a specific collection. Use library ID to fetch complete bibliographic information.

Instructions

Get all papers from a specific library. Returns paper details for papers in the specified collection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
library_idYesLibrary ID (from list_libraries)

Implementation Reference

  • The handler function that retrieves papers from a specific NASA ADS library by ID, fetches the bibcodes via API, queries paper details using ads.SearchQuery, and formats a list of papers with titles, authors, years, citations, and bibcodes.
    async def get_library_papers(library_id: str) -> list[TextContent]:
        """Get papers from a library."""
        try:
            response = requests.get(
                f"{ADS_API_BASE}/biblib/libraries/{library_id}",
                headers=HEADERS,
                timeout=30
            )
            response.raise_for_status()
            
            data = response.json()
            bibcodes = data.get("documents", [])
            
            if not bibcodes:
                return [TextContent(
                    type="text",
                    text=f"No papers in library {library_id}"
                )]
            
            # Get paper details
            papers = ads.SearchQuery(
                q=f"bibcode:({' OR '.join(bibcodes)})",
                fl=["bibcode", "title", "author", "year", "citation_count"],
                rows=len(bibcodes)
            )
            
            paper_lines = [f"Papers in library {data.get('name', library_id)}:\n"]
            for i, paper in enumerate(papers, 1):
                authors = paper.author[:2] if paper.author else ["Unknown"]
                author_str = ", ".join(authors)
                if paper.author and len(paper.author) > 2:
                    author_str += " et al."
                
                paper_lines.append(
                    f"{i}. {paper.title[0] if paper.title else 'No title'}\n"
                    f"   {author_str} ({paper.year}) | Citations: {paper.citation_count or 0}\n"
                    f"   Bibcode: {paper.bibcode}\n"
                )
            
            return [TextContent(type="text", text="\n".join(paper_lines))]
        
        except Exception as e:
            logger.error(f"Error getting library papers: {e}")
            return [TextContent(
                type="text",
                text=f"Error getting library papers: {str(e)}"
            )]
  • The tool registration in the list_tools() function, defining the name, description, and input schema for get_library_papers.
    Tool(
        name="get_library_papers",
        description=(
            "Get all papers from a specific library. "
            "Returns paper details for papers in the specified collection."
        ),
        inputSchema={
            "type": "object",
            "properties": {
                "library_id": {
                    "type": "string",
                    "description": "Library ID (from list_libraries)",
                },
            },
            "required": ["library_id"],
        },
    ),
  • The dispatch logic in the call_tool() function that routes calls to the get_library_papers handler.
    elif name == "get_library_papers":
        return await get_library_papers(library_id=arguments["library_id"])
  • The input schema defining the required 'library_id' parameter as a string.
    inputSchema={
        "type": "object",
        "properties": {
            "library_id": {
                "type": "string",
                "description": "Library ID (from list_libraries)",
            },
        },
        "required": ["library_id"],
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool returns paper details but doesn't specify format, pagination, error handling, or performance aspects like rate limits. This leaves significant gaps in understanding how the tool behaves beyond basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured in two sentences, front-loaded with the core purpose and followed by return details. There's no wasted text, though it could be slightly more informative to improve completeness without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete. It doesn't explain what 'paper details' includes, how results are formatted, or any behavioral traits like error cases. For a tool with one parameter but missing structured context, this leaves too many gaps for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the parameter 'library_id' documented as 'Library ID (from list_libraries)'. The description adds minimal value beyond this, mentioning 'specified collection' which aligns with the schema but doesn't provide additional syntax or format details. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get all papers') and resource ('from a specific library'), with the purpose being to retrieve paper details for a collection. It distinguishes from siblings like 'get_author_papers' or 'get_paper_details' by focusing on library-based retrieval, though it doesn't explicitly contrast them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'search_papers' or 'get_author_papers', nor does it mention prerequisites such as needing a library ID from 'list_libraries'. The description implies usage for library-specific papers but lacks explicit context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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