Skip to main content
Glama
openags

Paper Search MCP

by openags

download_hal

Download PDF documents from HAL repository using paper identifiers to access academic research papers for local storage and reference.

Instructions

Download PDF for a paper from HAL.

Args: paper_id: HAL 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 entry-point MCP tool `download_hal` which delegates to the `HALSearcher` instance.
    async def download_hal(paper_id: str, save_path: str = "./downloads") -> str:
        """Download PDF for a paper from HAL.
    
        Args:
            paper_id: HAL paper identifier.
            save_path: Directory to save the PDF (default: './downloads').
        Returns:
            str: Path to downloaded PDF.
        """
        return hal_searcher.download_pdf(paper_id, save_path)
  • The actual `download_pdf` method within `HALSearcher` that performs the file download logic for HAL papers.
    def download_pdf(self, paper_id: str, save_path: str = "./downloads") -> str:
        """Download an open-access PDF from HAL.
    
        Args:
            paper_id: HAL identifier (e.g. ``hal-01234567``) or the value
                returned in ``paper.paper_id`` (``hal:<id>``).
            save_path: Directory to save the downloaded PDF.
    
        Returns:
            Absolute path to saved PDF or an error message string.
        """
        import os
    
        hal_id = self._normalise_id(paper_id)
        pdf_url = self._resolve_pdf_url(hal_id)
        if not pdf_url:
            return (
                f"No open-access PDF found on HAL for {hal_id}. "
                "The document may be metadata-only or under embargo."
            )
    
        os.makedirs(save_path, exist_ok=True)
        safe_name = re.sub(r"[^a-zA-Z0-9._-]+", "_", hal_id) or hal_id
        output_path = os.path.join(save_path, f"hal_{safe_name}.pdf")
    
        try:
            dl_response = self.session.get(pdf_url, stream=True, timeout=60)
            dl_response.raise_for_status()
            with open(output_path, "wb") as fh:
                for chunk in dl_response.iter_content(chunk_size=8192):
                    fh.write(chunk)
            return output_path
        except Exception as exc:
            return f"Failed to download HAL PDF from {pdf_url}: {exc}"
  • Registration of the `download_pdf` method in the tool mapping.
    "hal": hal_searcher.download_pdf,
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 behavior. It mentions downloading a PDF and returning a path, but lacks details on error handling, network behavior, authentication needs, or rate limits. For a download operation, this is insufficient to inform an agent about potential issues or requirements.

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. However, the Args/Returns formatting is slightly verbose for such a simple tool, but it remains efficient overall.

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 no annotations and an output schema (implied by 'Returns: str'), the description covers basic purpose and parameters adequately. However, for a download tool with potential complexities like network errors or file system interactions, it lacks behavioral details that would help an agent use it correctly in varied contexts.

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 'HAL paper identifier' and 'save_path' with its default. This adds meaningful semantics beyond the bare schema, though it could provide more context on format or constraints for 'paper_id.'

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 HAL.' It specifies the verb ('Download'), resource ('PDF for a paper'), and source ('from HAL'), making the action clear. However, it does not explicitly differentiate from sibling tools like 'download_arxiv' or 'read_hal_paper,' which reduces clarity in context.

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 like 'download_arxiv' and 'read_hal_paper,' there is no indication of when this specific download tool is appropriate, such as for HAL papers only or in comparison to read tools. This lack of context leaves usage ambiguous.

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