Skip to main content
Glama
h-lu

Paper Search MCP Server

by h-lu

download_iacr

Download free PDFs from IACR ePrint using paper IDs like '2024/123' to access cryptographic research papers directly.

Instructions

Download PDF from IACR ePrint (always free).

Args:
    paper_id: IACR ID (e.g., '2024/123', '2009/101').
    save_path: Directory to save PDF.

Returns:
    Path to downloaded PDF.

Example:
    download_iacr("2024/123")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paper_idYes
save_pathNo

Implementation Reference

  • MCP tool handler and registration for download_iacr. Defines input schema via type hints and docstring, delegates to generic _download using 'iacr' searcher.
    @mcp.tool()
    async def download_iacr(paper_id: str, save_path: Optional[str] = None) -> str:
        """Download PDF from IACR ePrint (always free).
        
        Args:
            paper_id: IACR ID (e.g., '2024/123', '2009/101').
            save_path: Directory to save PDF.
        
        Returns:
            Path to downloaded PDF.
        
        Example:
            download_iacr("2024/123")
        """
        return await _download('iacr', paper_id, save_path)
  • Exact implementation of the PDF download logic in IACRSearcher class, constructing the PDF URL and performing the HTTP download.
    def download_pdf(self, paper_id: str, save_path: str) -> str:
        """
        Download PDF from IACR ePrint Archive
    
        Args:
            paper_id: IACR paper ID (e.g., "2025/1014")
            save_path: Path to save the PDF
    
        Returns:
            str: Path to downloaded file or error message
        """
        try:
            pdf_url = f"{self.IACR_BASE_URL}/{paper_id}.pdf"
    
            response = self.session.get(pdf_url)
    
            if response.status_code == 200:
                filename = f"{save_path}/iacr_{paper_id.replace('/', '_')}.pdf"
                with open(filename, "wb") as f:
                    f.write(response.content)
                return filename
            else:
                return f"Failed to download PDF: HTTP {response.status_code}"
    
        except Exception as e:
            logger.error(f"PDF download error: {e}")
            return f"Error downloading PDF: {e}"
  • Generic download helper function that dispatches to the specific platform's searcher.download_pdf method.
    async def _download(
        searcher_name: str, 
        paper_id: str, 
        save_path: Optional[str] = None
    ) -> str:
        """通用下载函数"""
        if save_path is None:
            save_path = get_download_path()
        
        searcher = SEARCHERS.get(searcher_name)
        if not searcher:
            return f"Error: Unknown searcher {searcher_name}"
        
        try:
            return searcher.download_pdf(paper_id, save_path)
        except NotImplementedError as e:
            return str(e)
        except Exception as e:
            logger.error(f"Download failed for {searcher_name}: {e}")
            return f"Error downloading: {str(e)}"
  • Global SEARCHERS dictionary that instantiates and provides the IACRSearcher instance under the 'iacr' key for use by download handlers.
    SEARCHERS = {
        'arxiv': ArxivSearcher(),
        'pubmed': PubMedSearcher(),
        'biorxiv': BioRxivSearcher(),
        'medrxiv': MedRxivSearcher(),
        'google_scholar': GoogleScholarSearcher(),
        'iacr': IACRSearcher(),
        'semantic': SemanticSearcher(),
        'crossref': CrossRefSearcher(),
        'repec': RePECSearcher(),
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that downloads are 'always free', which is useful behavioral context about cost/access. However, it doesn't mention error handling, network behavior, file naming conventions, or what happens if save_path is null. More behavioral details would be helpful for a mutation tool.

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

Conciseness5/5

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

Perfectly structured with a clear purpose statement, parameter explanations, return value, and example. Every sentence earns its place. The information is front-loaded with the core functionality stated first.

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?

For a 2-parameter download tool with no annotations and no output schema, the description covers the basics well but lacks details about error conditions, file naming, default save behavior when save_path is null, and network/timeout characteristics. The example helps but doesn't fully compensate for these 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 must compensate. It provides clear semantics for both parameters: paper_id format ('IACR ID e.g., 2024/123') and save_path purpose ('Directory to save PDF'). The example shows usage with one parameter. This adds significant value beyond the bare schema.

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 ('Download PDF'), resource ('from IACR ePrint'), and scope ('always free'), distinguishing it from sibling tools like 'read_iacr_paper' or 'search_iacr' that perform different operations on the same resource.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool ('Download PDF from IACR ePrint') and implicitly distinguishes it from alternatives by specifying the free nature, unlike tools like 'download_scihub' which might involve different access methods. The context of sibling tools reinforces this distinction.

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

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