Skip to main content
Glama
renyumeng1

mcp-scholar

paper_detail

Retrieve detailed information about a specific paper using its unique ID. Integrates with the MCP Scholar server to support research analysis and data extraction from Google Scholar.

Instructions

获取论文详细信息

Args:
    paper_id: 论文ID

Returns:
    Dict: 论文详细信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paper_idYes

Implementation Reference

  • The MCP tool handler for 'paper_detail' that takes a paper_id, calls the helper get_paper_detail, processes the result (adding URLs), and returns success/error dict.
    @mcp.tool()
    async def paper_detail(ctx: Context, paper_id: str) -> Dict[str, Any]:
        """
        获取论文详细信息
    
        Args:
            paper_id: 论文ID
    
        Returns:
            Dict: 论文详细信息
        """
        try:
            # 移除进度显示
            logger.info(f"正在获取论文ID为 {paper_id} 的详细信息...")
            detail = await get_paper_detail(paper_id)
    
            if detail:
                # 确保URL信息被返回
                if "url" not in detail and detail.get("pub_url"):
                    detail["url"] = detail["pub_url"]
    
                # 如果有DOI,添加DOI URL
                if "doi" in detail and "doi_url" not in detail:
                    detail["doi_url"] = f"https://doi.org/{detail['doi']}"
    
                return {"status": "success", "detail": detail}
            else:
                # 移除错误通知
                logger.warning(f"未找到ID为 {paper_id} 的论文")
                return {"status": "error", "message": f"未找到ID为 {paper_id} 的论文"}
        except Exception as e:
            # 移除错误通知
            logger.error(f"获取论文详情失败: {str(e)}", exc_info=True)
            return {"status": "error", "message": "论文详情服务暂时不可用", "error": str(e)}
  • Core helper function that queries the OpenAlex API to fetch detailed paper information based on paper_id (supports DOI, OpenAlex ID, arXiv), processes abstract from inverted index, extracts authors, venue, DOI, PDF, concepts.
    async def get_paper_detail(paper_id: str) -> Optional[Dict[str, Any]]:
        """
        通过OpenAlex API获取论文详情
    
        Args:
            paper_id: 论文ID,可以是OpenAlex ID、DOI或ArXiv ID
    
        Returns:
            Dict: 论文详细信息
        """
        try:
            # 设置电子邮件参数(礼貌请求)
            email_param = f"?mailto={EMAIL}" if EMAIL else ""
    
            # 确定使用什么ID类型
            if paper_id.startswith("10."):  # 看起来是DOI
                api_url = f"{OPENALEX_API}/works/doi:{paper_id}{email_param}"
            elif paper_id.startswith("W"):  # OpenAlex ID
                api_url = f"{OPENALEX_API}/works/{paper_id}{email_param}"
            elif paper_id.lower().startswith("arxiv:"):  # arXiv ID
                api_url = f"{OPENALEX_API}/works/arxiv:{paper_id.replace('arxiv:', '')}{email_param}"
            else:  # 尝试作为OpenAlex ID (不带前缀的)
                api_url = f"{OPENALEX_API}/works/W{paper_id}{email_param}"
    
            async with httpx.AsyncClient(timeout=10.0) as client:
                response = await client.get(api_url)
    
                if response.status_code == 200:
                    data = response.json()
    
                    # 提取论文详细信息
                    result = {
                        "title": data.get("title", "未知标题"),
                        "abstract": "",  # 默认为空,稍后处理
                        "citations": data.get("cited_by_count", 0),
                        "year": data.get("publication_year", "未知年份"),
                        "venue": "",  # 需要从期刊/会议信息中提取
                        "paper_id": data.get("id", "").replace("https://openalex.org/", ""),
                        "url": data.get("id", ""),
                    }
    
                    # 处理摘要(OpenAlex 摘要是倒排索引格式)
                    if data.get("abstract_inverted_index"):
                        result["abstract"] = convert_inverted_index_to_text(
                            data.get("abstract_inverted_index", {})
                        )
    
                    # 处理作者信息
                    authors = data.get("authorships", [])
                    author_names = []
                    for author in authors:
                        if author.get("author", {}).get("display_name"):
                            author_names.append(author["author"]["display_name"])
                    result["authors"] = ", ".join(author_names)
    
                    # 处理期刊/会议信息
                    if data.get("host_venue", {}).get("display_name"):
                        result["venue"] = data["host_venue"]["display_name"]
    
                    # 处理DOI信息
                    if data.get("doi"):
                        result["doi"] = data["doi"]
                        result["doi_url"] = f"https://doi.org/{result['doi']}"
    
                    # 添加PDF链接(如果有)
                    if data.get("open_access", {}).get("oa_url"):
                        result["pdf_url"] = data["open_access"]["oa_url"]
    
                    # 添加关键概念
                    if data.get("concepts"):
                        concepts = []
                        for concept in data["concepts"]:
                            if (
                                concept.get("display_name")
                                and concept.get("score", 0) > 0.5
                            ):  # 只添加相关性高的概念
                                concepts.append(concept["display_name"])
                        if concepts:
                            result["concepts"] = ", ".join(concepts)
    
                    return result
                else:
                    print(f"获取论文详情错误: {response.status_code} - {response.text}")
                    return None
    
        except Exception as e:
            print(f"获取论文详情时出错: {str(e)}")
            return None
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states it retrieves details but doesn't mention whether this is a read-only operation, requires authentication, has rate limits, or what happens with invalid paper IDs. For a tool with zero annotation coverage, this represents significant gaps in behavioral context.

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 appropriately brief with clear sections for Args and Returns. However, the Chinese text '获取论文详细信息' could be more specific, and the structure while clean doesn't fully compensate for content gaps. It's efficient but could be more informative within its concise format.

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

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations, no output schema, and 0% schema description coverage, the description is insufficient. It doesn't explain what '论文详细信息' (paper details) includes, the return format beyond 'Dict', error conditions, or how this differs from sibling tools. The minimal information provided doesn't adequately support tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter documentation. The description only states 'paper_id: 论文ID' (paper ID), which adds minimal semantic value beyond the parameter name. It doesn't explain format requirements, valid ranges, or examples of paper IDs, leaving the single parameter inadequately documented.

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

Purpose3/5

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

The description states '获取论文详细信息' (Get paper details), which provides a basic verb+resource combination. However, it doesn't differentiate from sibling tools like 'paper_references' or 'profile_papers' that might also retrieve paper-related information. The purpose is clear but lacks specificity about what distinguishes this tool from alternatives.

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?

No guidance is provided about when to use this tool versus alternatives like 'paper_references' or 'profile_papers'. The description only states what the tool does without indicating appropriate contexts, prerequisites, or exclusions. This leaves the agent without direction on tool selection.

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

Related 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/renyumeng1/mcp_scholar'

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