Skip to main content
Glama
fegizii

Semantic Scholar MCP Server

by fegizii

get_citation_context

Retrieve the specific context where one academic paper cites another to understand citation relationships and scholarly discussions.

Instructions

Get the context in which one paper cites another.

Args:
    paper_id: ID of the paper being cited
    citing_paper_id: ID of the paper doing the citing

Returns:
    Citation context information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paper_idYes
citing_paper_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'get_citation_context' tool, decorated with @mcp.tool() which also serves as its registration in the FastMCP server. It fetches citation context from the Semantic Scholar API endpoint /paper/{paper_id}/citations/{citing_paper_id}, extracts contexts, paper titles, and formats a response string with the citation snippets.
    @mcp.tool()
    async def get_citation_context(paper_id: str, citing_paper_id: str) -> str:
        """
        Get the context in which one paper cites another.
    
        Args:
            paper_id: ID of the paper being cited
            citing_paper_id: ID of the paper doing the citing
    
        Returns:
            Citation context information
        """
        encoded_paper_id = quote(paper_id, safe="")
        encoded_citing_id = quote(citing_paper_id, safe="")
    
        result = await make_api_request(
            f"paper/{encoded_paper_id}/citations/{encoded_citing_id}"
        )
    
        if result is None:
            return "Error: Failed to fetch citation context"
    
        if "error" in result:
            return f"Error: {result['error']}"
    
        contexts = result.get("contexts", [])
        citing_paper = result.get("citingPaper", {})
        cited_paper = result.get("citedPaper", {})
    
        if not contexts:
            return "No citation context found."
    
        result_text = "Citation context:\n\n"
        result_text += f"Cited paper: {cited_paper.get('title', 'Unknown')}\n"
        result_text += f"Citing paper: {citing_paper.get('title', 'Unknown')}\n\n"
    
        for i, context in enumerate(contexts, 1):
            result_text += f"{i}. {context}\n"
    
        return result_text
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves citation context but doesn't cover critical aspects like whether it's a read-only operation, potential rate limits, authentication needs, error conditions, or what 'context information' entails (e.g., text snippets, metadata). This leaves significant gaps in understanding how the tool behaves.

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 highly concise and well-structured: a clear purpose statement followed by brief sections for 'Args' and 'Returns'. Each sentence earns its place by providing essential information without redundancy, making it easy to scan and understand quickly.

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, the description doesn't need to detail return values. However, with no annotations and low parameter semantics coverage, it lacks completeness for a tool that involves data retrieval. It adequately states the purpose but misses behavioral and usage context that would help an agent use it effectively.

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%, so the schema provides no parameter descriptions. The description adds minimal semantics by naming the parameters ('paper_id' and 'citing_paper_id') and implying their roles, but it doesn't explain format (e.g., numeric IDs, strings), constraints, or examples. This compensates slightly but not fully for the lack of schema documentation.

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 the context in which one paper cites another.' This specifies the verb ('Get') and resource ('context'), making it understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_paper_citations' or 'get_paper_references', which might handle related citation data, so it falls short of a perfect score.

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 sibling tools like 'get_paper_citations' or 'search_snippets', which could be relevant for citation-related queries. Without any context on usage scenarios or exclusions, the agent must infer when this tool is appropriate.

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/fegizii/SemanticScholarMCP'

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