Skip to main content
Glama
openags

Paper Search MCP

by openags

download_medrxiv

Download PDF files from medRxiv by providing a paper DOI, saving them to a specified directory for local access to medical research preprints.

Instructions

Download PDF of a medRxiv paper.

Args: paper_id: medRxiv DOI. save_path: Directory to save the PDF (default: './downloads'). Returns: Path to the downloaded PDF file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paper_idYes
save_pathNo./downloads

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool definition and handler for download_medrxiv in the server.
    @mcp.tool()
    async def download_medrxiv(paper_id: str, save_path: str = "./downloads") -> str:
        """Download PDF of a medRxiv paper.
    
        Args:
            paper_id: medRxiv DOI.
            save_path: Directory to save the PDF (default: './downloads').
        Returns:
            Path to the downloaded PDF file.
        """
        return medrxiv_searcher.download_pdf(paper_id, save_path)
  • The actual implementation of the medRxiv PDF download logic within MedRxivSearcher.
    def download_pdf(self, paper_id: str, save_path: str) -> str:
        """
        Download a PDF for a given paper ID from medRxiv.
    
        Args:
            paper_id: The DOI of the paper.
            save_path: Directory to save the PDF.
    
        Returns:
            Path to the downloaded PDF file.
        """
        if not paper_id:
            raise ValueError("Invalid paper_id: paper_id is empty")
    
        pdf_url = f"https://www.medrxiv.org/content/{paper_id}v1.full.pdf"
        tries = 0
        while tries < self.max_retries:
            try:
                # Add User-Agent to avoid potential 403 errors
                headers = {
                    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
                }
                response = self.session.get(pdf_url, timeout=self.timeout, headers=headers)
                response.raise_for_status()
                os.makedirs(save_path, exist_ok=True)
                output_file = f"{save_path}/{paper_id.replace('/', '_')}.pdf"
                with open(output_file, 'wb') as f:
                    f.write(response.content)
                return output_file
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It mentions the action ('Download PDF') and return value ('Path to the downloaded PDF file'), but lacks critical details such as network behavior (e.g., rate limits, errors), file handling (e.g., overwrites, permissions), or authentication needs. This leaves significant gaps in understanding how the tool operates.

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 concise, with a clear purpose statement followed by 'Args' and 'Returns' sections. Each sentence adds value without redundancy. It could be slightly improved by integrating the sections more seamlessly, but overall, it's efficient and easy to parse.

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 (2 parameters, no annotations, but has an output schema), the description is partially complete. It covers the basic purpose and parameters, and the output schema likely details the return value, reducing the need for that in the description. However, it misses behavioral aspects (e.g., error handling, side effects) and usage context relative to siblings, making it adequate but with clear gaps.

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 compensates by explaining both parameters: 'paper_id' as 'medRxiv DOI' and 'save_path' with its default value. This adds meaningful context beyond the bare schema, clarifying the expected format for 'paper_id' and the purpose of 'save_path'. However, it doesn't detail constraints (e.g., DOI format, path validity), preventing a score of 5.

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 of a medRxiv paper.' It specifies the verb ('Download') and resource ('PDF of a medRxiv paper'), making it easy to understand. However, it does not explicitly differentiate from sibling tools like 'download_biorxiv' or 'read_medrxiv_paper', which reduces the score from a perfect 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_biorxiv', 'read_medrxiv_paper', 'search_medrxiv'), it fails to specify scenarios, prerequisites, or exclusions. This lack of context leaves the agent to infer usage, which is insufficient for effective tool selection.

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