Skip to main content
Glama
45645678a
by 45645678a

paper_health

Check availability of academic paper download sources including Unpaywall, arXiv, and Sci-Hub mirrors to verify service health for research access.

Instructions

检查论文下载服务各数据源的可用性(Unpaywall、arXiv、Sci-Hub 镜像)。

Returns: 各数据源健康状态的 JSON 字符串

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Tool registration and handler wrapper for paper_health in the MCP server.
    @mcp.tool()
    def paper_health() -> str:
        """检查论文下载服务各数据源的可用性(Unpaywall、arXiv、Sci-Hub 镜像)。
    
        Returns:
            各数据源健康状态的 JSON 字符串
        """
        result = health_check()
        return json.dumps(result, ensure_ascii=False, indent=2)
  • The core business logic that executes the health check for the paper health tool.
    def health_check() -> dict:
        """检查各下载源的可用性"""
        status = {"overall": "ok", "sources": {}}
    
        # 检查 Unpaywall
        try:
            r = requests.get(
                f"https://api.unpaywall.org/v2/10.1038/nature12373?email={UNPAYWALL_EMAIL}",
                timeout=10,
            )
            status["sources"]["unpaywall"] = "ok" if r.status_code == 200 else f"http_{r.status_code}"
        except Exception as e:
            status["sources"]["unpaywall"] = f"error: {str(e)[:60]}"
    
        # 检查 arXiv
        try:
            r = requests.head(f"{ARXIV_PDF_BASE}2301.00001", timeout=10, allow_redirects=True)
            status["sources"]["arxiv"] = "ok" if r.status_code == 200 else f"http_{r.status_code}"
        except Exception as e:
            status["sources"]["arxiv"] = f"error: {str(e)[:60]}"
    
        # 检查 Sci-Hub 镜像
        scihub_status = {}
        for mirror in SCIHUB_MIRRORS:
            try:
                r = requests.get(mirror, timeout=10)
                scihub_status[mirror] = "ok" if r.status_code == 200 else f"http_{r.status_code}"
            except Exception as e:

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/45645678a/scholar-mcp'

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