Skip to main content
Glama
smaniches

Semantic Scholar MCP Server

by smaniches

semantic_scholar_get_paper

Retrieve academic paper details using identifiers like DOI, arXiv ID, or S2 ID, with options to include citations and references for comprehensive research analysis.

Instructions

Get paper details. Accepts: S2 ID, DOI:xxx, ARXIV:xxx, PMID:xxx, CorpusId:xxx

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function `get_paper_details` for the `semantic_scholar_get_paper` tool. It fetches paper details from the Semantic Scholar API, optionally including citations and references, and formats the output in Markdown or JSON.
    @mcp.tool(name="semantic_scholar_get_paper")
    async def get_paper_details(params: PaperDetailsInput) -> str:
        """Get paper details. Accepts: S2 ID, DOI:xxx, ARXIV:xxx, PMID:xxx, CorpusId:xxx"""
        logger.info(f"Getting paper: {params.paper_id}")
        
        paper = await _make_request("GET", f"paper/{params.paper_id}", params={"fields": ",".join(PAPER_FIELDS)})
        result = {"paper": paper}
        
        if params.include_citations:
            cit = await _make_request("GET", f"paper/{params.paper_id}/citations", params={"fields": ",".join(PAPER_FIELDS), "limit": params.citations_limit})
            result["citations"] = cit.get("data", [])
        if params.include_references:
            ref = await _make_request("GET", f"paper/{params.paper_id}/references", params={"fields": ",".join(PAPER_FIELDS), "limit": params.references_limit})
            result["references"] = ref.get("data", [])
        
        if params.response_format == ResponseFormat.JSON:
            return json.dumps(result, indent=2)
        
        lines = ["## Paper Details", "", _format_paper_markdown(paper)]
        if result.get("citations"):
            lines.extend(["---", f"### Citing Papers ({len(result['citations'])} shown)", ""])
            for c in result["citations"]:
                p = c.get("citingPaper", {})
                if p: lines.append(f"- **{p.get('title', '?')}** ({p.get('year', '')}) - {p.get('citationCount', 0)} citations")
        if result.get("references"):
            lines.extend(["---", f"### References ({len(result['references'])} shown)", ""])
            for r in result["references"]:
                p = r.get("citedPaper", {})
                if p: lines.append(f"- **{p.get('title', '?')}** ({p.get('year', '')}) - {p.get('citationCount', 0)} citations")
        return "\n".join(lines)
  • Pydantic input schema `PaperDetailsInput` used by the tool handler for input validation and type hints.
    class PaperDetailsInput(BaseModel):
        model_config = ConfigDict(str_strip_whitespace=True, extra="forbid")
        paper_id: str = Field(..., description="Paper ID: S2 ID, DOI:xxx, ARXIV:xxx, PMID:xxx, CorpusId:xxx", min_length=1)
        include_citations: bool = Field(default=False, description="Include citing papers")
        include_references: bool = Field(default=False, description="Include referenced papers")
        citations_limit: int = Field(default=10, description="Max citations to return", ge=1, le=100)
        references_limit: int = Field(default=10, description="Max references to return", ge=1, le=100)
        response_format: ResponseFormat = Field(default=ResponseFormat.MARKDOWN, description="Output format")
  • The `@mcp.tool` decorator registers the `get_paper_details` function as the 'semantic_scholar_get_paper' tool with FastMCP.
    @mcp.tool(name="semantic_scholar_get_paper")
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It mentions what identifiers are accepted but doesn't disclose rate limits, authentication requirements, error behaviors, or what 'paper details' actually includes. The description doesn't contradict annotations (none exist), but it's insufficient for a mutation/query tool.

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 (two sentences) and front-loaded with the core purpose. Every word earns its place, though it could be slightly more structured by separating purpose from parameter guidance.

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 the tool has an output schema (which handles return values) and relatively simple parameters, the description is minimally adequate. However, for a tool with 6 total parameters (1 required, 5 optional) and no annotations, it should provide more context about optional behaviors and usage constraints.

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?

Schema description coverage is 0%, but the description compensates by listing acceptable paper_id formats (S2 ID, DOI:xxx, etc.). However, it completely ignores the other 5 parameters (include_citations, include_references, limits, response_format) that appear in the schema, leaving significant gaps in parameter understanding.

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 ('Get paper details') and specifies the resource (papers), making it immediately understandable. However, it doesn't differentiate from sibling tools like 'semantic_scholar_search_papers' or 'semantic_scholar_bulk_papers', which would require more specific scope definition.

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. It doesn't mention that this is for retrieving details of a single known paper (versus searching for papers or getting bulk data), nor does it reference sibling tools like 'semantic_scholar_search_papers' for discovery scenarios.

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/smaniches/semantic-scholar-mcp'

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