Skip to main content
Glama
openags

Paper Search MCP

by openags

read_medrxiv_paper

Extract text content from medRxiv paper PDFs using DOI identifiers for analysis and research purposes.

Instructions

Read and extract text content from a medRxiv paper PDF.

Args: paper_id: medRxiv DOI. save_path: Directory where the PDF is/will be saved (default: './downloads'). Returns: str: The extracted text content of the paper.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paper_idYes
save_pathNo./downloads

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The tool handler `read_medrxiv_paper` in `server.py` calls the `read_paper` method of `medrxiv_searcher`.
    async def read_medrxiv_paper(paper_id: str, save_path: str = "./downloads") -> str:
        """Read and extract text content from a medRxiv paper PDF.
    
        Args:
            paper_id: medRxiv DOI.
            save_path: Directory where the PDF is/will be saved (default: './downloads').
        Returns:
            str: The extracted text content of the paper.
        """
        try:
            return medrxiv_searcher.read_paper(paper_id, save_path)
        except Exception as e:
            print(f"Error reading paper {paper_id}: {e}")
            return ""
  • The `MedRxivSearcher.read_paper` implementation handles downloading (if necessary) and text extraction from the PDF.
    def read_paper(self, paper_id: str, save_path: str = "./downloads") -> str:
        """
        Read a paper and convert it to text format.
        
        Args:
            paper_id: medRxiv DOI
            save_path: Directory where the PDF is/will be saved
            
        Returns:
            str: The extracted text content of the paper
        """
        pdf_path = f"{save_path}/{paper_id.replace('/', '_')}.pdf"
        if not os.path.exists(pdf_path):
            pdf_path = self.download_pdf(paper_id, save_path)
        
        try:
            reader = PdfReader(pdf_path)
            text = ""
            for page in reader.pages:
                text += page.extract_text() + "\n"
            return text.strip()
        except Exception as e:
            print(f"Error reading PDF for paper {paper_id}: {e}")
            return ""
  • The `read_medrxiv_paper` tool is registered using the `@mcp.tool()` decorator.
    @mcp.tool()
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral disclosure. It mentions downloading/saving PDFs (via save_path) and text extraction, but doesn't cover critical aspects like error handling (e.g., invalid DOI), network dependencies, file system permissions, or performance characteristics (e.g., extraction time). The description doesn't contradict annotations (none exist), but fails to adequately inform about operational 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 efficiently structured with a clear purpose statement followed by Args/Returns sections. Every sentence adds value, though the 'Args' and 'Returns' labels are slightly redundant with the schema. It's appropriately sized for a tool with two parameters.

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

Completeness4/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 (PDF processing), no annotations, and an output schema (which covers return type), the description is reasonably complete. It covers purpose, parameters, and return value, but could improve by addressing behavioral aspects like error conditions or dependencies. The presence of an output schema reduces the need to explain returns in the description.

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%, but the description compensates well by explaining both parameters: 'paper_id' is clarified as a 'medRxiv DOI', and 'save_path' specifies the directory purpose and default value. This adds meaningful context beyond the bare schema, though it doesn't detail DOI format requirements or save_path constraints.

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

Purpose5/5

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

The description clearly states the specific action ('Read and extract text content'), the resource ('from a medRxiv paper PDF'), and distinguishes it from sibling tools like 'download_medrxiv' (which likely downloads without extraction) and 'read_arxiv_paper' (which handles a different source). It goes beyond just restating the name by specifying the extraction functionality.

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

Usage Guidelines3/5

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

The description implies usage when text extraction from medRxiv PDFs is needed, but provides no explicit guidance on when to use this tool versus alternatives like 'download_medrxiv' (for just downloading) or other 'read_*' tools for different sources. It lacks any 'when-not-to-use' statements or prerequisites.

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