Skip to main content
Glama
smaniches

Semantic Scholar MCP Server

by smaniches

semantic_scholar_match_paper

Read-onlyIdempotent

Retrieves the best matching paper for a given title and returns a match score to assess relevance.

Instructions

Find the single best paper matching a title string. Returns match score.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `match_paper` async function is the handler for the 'semantic_scholar_match_paper' tool. It calls the Semantic Scholar API endpoint 'paper/search/match' with the query title, returns the best matching paper along with a match score. Supports both markdown and JSON response formats.
    @mcp.tool(
        name="semantic_scholar_match_paper",
        annotations=ToolAnnotations(readOnlyHint=True, idempotentHint=True, openWorldHint=True),
    )
    async def match_paper(params: PaperMatchInput) -> str:
        """Find the single best paper matching a title string. Returns match score."""
        logger.info("Matching paper: %s", params.query)
    
        try:
            response = await _make_request(
                "GET",
                "paper/search/match",
                params={"query": params.query, "fields": ",".join(PAPER_SEARCH_FIELDS)},
                api_key=params.api_key,
            )
            papers = response.get("data", []) if isinstance(response, dict) else []
        except SemanticScholarError as e:
            raise ToolError(str(e)) from e
    
        if not papers:
            return "No matching paper found."
    
        paper = papers[0]
        match_score = paper.get("matchScore", 0)
    
        if params.response_format == ResponseFormat.JSON:
            return json.dumps({"matchScore": match_score, "paper": paper}, indent=2)
    
        lines = [
            "## Paper Match",
            f"**Match Score:** {match_score:.1f}",
            "",
            _format_paper_markdown(paper),
        ]
        return "\n".join(lines)
  • The `PaperMatchInput` Pydantic model defines the input schema for the tool, with fields: query (paper title, required), response_format (default 'markdown'), and api_key (optional).
    class PaperMatchInput(BaseModel):
        model_config = ConfigDict(str_strip_whitespace=True, extra="forbid")
        query: str = Field(..., description="Paper title to match", min_length=1, max_length=500)
        response_format: ResponseFormat = Field(
            default=ResponseFormat.MARKDOWN, description="Output format"
        )
        api_key: str | None = Field(
            default=None,
            description="API key (overrides SEMANTIC_SCHOLAR_API_KEY env var)",
        )
  • The tool is registered via the `@mcp.tool(name='semantic_scholar_match_paper', ...)` decorator on the `match_paper` function. The decorator also sets annotations marking it as read-only, idempotent, and open-world.
    @mcp.tool(
        name="semantic_scholar_match_paper",
        annotations=ToolAnnotations(readOnlyHint=True, idempotentHint=True, openWorldHint=True),
    )
Behavior3/5

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

Annotations already indicate readOnlyHint=true, idempotentHint=true, openWorldHint=true, which cover safety and idempotency. Description adds that it returns a match score, but does not disclose any additional behavioral traits such as fuzzy matching behavior or response structure details.

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?

Two sentences, no filler, front-loaded with key information. Every word earns its place.

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

Completeness4/5

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

Given the tool's simplicity, annotations cover safety, schema covers parameters, and output schema exists, the description is sufficiently complete. It could mention the output format (markdown/json) or that it uses the Semantic Scholar API, but these are minor omissions.

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?

Input schema provides descriptions for all three parameters (query, response_format, api_key), so schema coverage is effectively high. Description adds no additional parameter meaning beyond what the schema already provides, so baseline of 3 applies.

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

Purpose5/5

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

Description clearly states the tool finds the single best paper matching a title string and returns a match score. The verb 'Find' and resource 'single best paper' differentiate it from sibling tools like search_papers (multiple results) and get_paper (by ID).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Description implies use when you have a title and want the best match, but does not explicitly state when to use versus alternatives like search or get_paper. No guidance on context or exclusions.

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