Skip to main content
Glama
openags

Paper Search MCP

by openags

download_doaj

Download PDF files from DOAJ using paper identifiers. Specify a paper ID to retrieve and save academic papers to a designated directory for research access.

Instructions

Download PDF for a paper from DOAJ.

Args: paper_id: DOAJ paper identifier. save_path: Directory to save the PDF (default: './downloads'). Returns: str: Path to downloaded PDF.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paper_idYes
save_pathNo./downloads

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool registration and entry point for 'download_doaj'.
    @mcp.tool()
    async def download_doaj(paper_id: str, save_path: str = "./downloads") -> str:
        """Download PDF for a paper from DOAJ.
    
        Args:
            paper_id: DOAJ paper identifier.
            save_path: Directory to save the PDF (default: './downloads').
        Returns:
            str: Path to downloaded PDF.
        """
        return doaj_searcher.download_pdf(paper_id, save_path)
  • The actual logic implementation for downloading a DOAJ PDF within the DOAJSearcher class. (Snippet simplified)
    def download_pdf(self, paper_id: str, save_path: str) -> str:
        """Download PDF for a DOAJ article.
    
        DOAJ provides direct PDF links for open access articles.
    
        Args:
            paper_id: DOAJ article ID or DOI
            save_path: Directory to save PDF
    
        Returns:
            Path to saved PDF file
    
        Raises:
            ValueError: If paper not found or no PDF available
            IOError: If download fails
        """
        # Try to get paper info first
        papers = self.search(paper_id, max_results=1)
        if not papers:
            raise ValueError(f"DOAJ article not found: {paper_id}")
    
        paper = papers[0]
        if not paper.pdf_url:
            # Try to construct PDF URL from DOI
            if paper.doi:
                # Some publishers provide direct PDF links via DOI
                pdf_url = f"https://doi.org/{paper.doi}"
                # But we need to check if it's actually a PDF
                # For now, try the URL
                paper.pdf_url = pdf_url
            else:
                raise ValueError(f"No PDF available for DOAJ article: {paper_id}")
    
        # Download PDF
        import os
        response = self.session.get(paper.pdf_url, timeout=30)
        response.raise_for_status()
    
        # Check if response is actually PDF
        content_type = response.headers.get('content-type', '')
        if 'pdf' not in content_type.lower() and not paper.pdf_url.lower().endswith('.pdf'):
            logger.warning(f"Response may not be PDF: {content_type}")
    
        os.makedirs(save_path, exist_ok=True)
    
        # Create safe filename
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions downloading a PDF and returning a path, but lacks details on permissions, rate limits, error handling, or what happens if the paper_id is invalid. For a download operation with no annotations, this leaves significant gaps in understanding the tool's behavior.

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 well-structured and efficient: a clear purpose statement followed by Args and Returns sections. Every sentence adds value, with no wasted words. It could be slightly more front-loaded by integrating parameter hints into the main description, but overall it's concise and organized.

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

Completeness3/5

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

Given the tool's moderate complexity (download operation), no annotations, and an output schema (implied by 'Returns: str: Path to downloaded PDF'), the description is minimally adequate. It covers purpose and parameters but lacks behavioral details (e.g., network effects, errors). The output schema reduces the need to explain return values, but more context on usage and limitations would improve completeness.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It adds meaningful context: 'paper_id: DOAJ paper identifier' clarifies the parameter's purpose beyond the schema's 'Paper Id', and 'save_path: Directory to save the PDF (default: './downloads')' explains usage and default behavior. This effectively documents both parameters, though it could elaborate on format constraints (e.g., paper_id structure).

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 tool's purpose: 'Download PDF for a paper from DOAJ.' It specifies the verb ('Download'), resource ('PDF for a paper'), and source ('from DOAJ'), making the action clear. However, it doesn't explicitly differentiate from sibling tools like 'download_arxiv' or 'read_doaj_paper', which would require a 5.

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?

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools (e.g., 'download_arxiv', 'read_doaj_paper'), there's no indication of when DOAJ is the appropriate source or how this differs from other download or read tools. Usage is implied only by the tool name and description, not explicitly stated.

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/openags/paper-search-mcp'

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