Skip to main content
Glama

apaper_download_iacr_paper

Download the PDF of any IACR ePrint paper by providing its paper ID, with option to specify a save directory.

Instructions

Download PDF of an IACR ePrint paper

Args: paper_id: IACR paper ID (e.g., '2009/101') save_path: Directory to save the PDF (default: './downloads')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paper_idYes
save_pathNo./downloads

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler function 'download_iacr_paper' that serves as the entry point for the 'apaper_download_iacr_paper' tool. It takes paper_id and save_path parameters, calls iacr_searcher.download_pdf(), and returns a result string.
    @mcp.tool()
    def download_iacr_paper(paper_id: str, save_path: str = "./downloads") -> str:
        """
        Download PDF of an IACR ePrint paper
    
        Args:
            paper_id: IACR paper ID (e.g., '2009/101')
            save_path: Directory to save the PDF (default: './downloads')
        """
        try:
            result = iacr_searcher.download_pdf(paper_id, save_path)
    
            if result.startswith(("Error", "Failed")):
                return f"Download failed: {result}"
            else:
                return f"PDF downloaded successfully to: {result}"
        except Exception as e:
            return f"Error downloading IACR paper: {str(e)}"
  • Registration of the tool via the @mcp.tool() decorator on the download_iacr_paper function. FastMCP framework registers this as an MCP tool named 'download_iacr_paper'.
    @mcp.tool()
  • The IACRSearcher.download_pdf() method that does the actual PDF download logic. Constructs the PDF URL from the paper_id, makes a GET request, saves to disk, and returns the file path.
    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:
            os.makedirs(save_path, exist_ok=True)
            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}"
  • The docstring and function signature define the schema: paper_id (str, required) and save_path (str, optional, default './downloads').
    """
    Download PDF of an IACR ePrint paper
    
    Args:
        paper_id: IACR paper ID (e.g., '2009/101')
        save_path: Directory to save the PDF (default: './downloads')
    """
  • Abstract base method in PaperSource that defines the interface contract for download_pdf.
    @abstractmethod
    def download_pdf(self, paper_id: str, save_path: str) -> str:
        """Download PDF of a paper"""
        raise NotImplementedError
Behavior2/5

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

With no annotations, the description must fully disclose behavior, but it only mentions downloading a PDF, omitting details like file overwriting, error handling, or network requirements, leaving significant gaps.

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?

The description is concise with a front-loaded purpose and a clean 'Args' section. Every sentence is informative and there is no extraneous text.

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 low complexity (2 params, an output schema available) and the presence of sibling tools, the description covers the essential purpose and parameters, though it lacks behavioral details that would improve completeness.

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?

While schema description coverage is 0%, the description adds minimal meaning by providing an example for paper_id and a default for save_path, but does not elaborate on formats, validation, or constraints beyond the 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 tool downloads a PDF of an IACR ePrint paper, using a specific verb and resource, and distinguishes it from sibling search tools like apaper_search_iacr_papers.

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, such as after finding a paper ID via search. It only describes the action without context for appropriate usage.

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/isomoes/all-in-mcp'

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