Skip to main content
Glama
emi-dm

ArxivSearcher MCP Server

by emi-dm

find_related_papers

Discover academic papers related to a specific research title by analyzing keyword similarity, with options to filter results and set relevance thresholds.

Instructions

Find papers related to a given paper title using keyword similarity.

:param paper_title: Title of the reference paper :param max_results: Maximum number of related papers to return :param similarity_threshold: Minimum similarity score (0.0 to 1.0) :param category: Optional category filter

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paper_titleYes
max_resultsNo
similarity_thresholdNo
categoryNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function implementing the 'find_related_papers' tool. Extracts keywords from input paper title, constructs arXiv search query, retrieves candidate papers, filters by keyword overlap similarity threshold, sorts and returns top related papers.
    @mcp.tool
    def find_related_papers(
        paper_title: str,
        max_results: int = 10,
        similarity_threshold: float = 0.7,
        category: str | None = None,
    ) -> dict:
        """
        Find papers related to a given paper title using keyword similarity.
    
        :param paper_title: Title of the reference paper
        :param max_results: Maximum number of related papers to return
        :param similarity_threshold: Minimum similarity score (0.0 to 1.0)
        :param category: Optional category filter
        """
        try:
            # Extract keywords from the title
            stop_words = {
                "a",
                "an",
                "and",
                "the",
                "of",
                "in",
                "for",
                "to",
                "with",
                "on",
                "is",
                "are",
                "was",
                "were",
                "it",
            }
    
            keywords = [
                word.lower()
                for word in re.findall(r"\b\w+\b", paper_title)
                if word.lower() not in stop_words and len(word) > 2
            ]
    
            if not keywords:
                return {"error": "No meaningful keywords found in title"}
    
            # Create search query from keywords
            keyword_query = " OR ".join([f'(ti:"{kw}" OR abs:"{kw}")' for kw in keywords])
            query_parts = [f"({keyword_query})"]
    
            if category:
                query_parts.append(f"cat:{category}")
    
            final_query = " AND ".join(query_parts)
    
            # Search for related papers
            search = arxiv.Search(
                query=final_query,
                max_results=max_results * 2,  # Get more results to filter by similarity
                sort_by=arxiv.SortCriterion.Relevance,
                sort_order=arxiv.SortOrder.Descending,
            )
    
            results = []
    
            for r in search.results():
                # Calculate simple similarity based on keyword overlap
                paper_text = f"{r.title} {r.summary}".lower()
    
                # Count keyword matches
                matches = sum(1 for kw in keywords if kw in paper_text)
                similarity = matches / len(keywords) if keywords else 0
    
                if similarity >= similarity_threshold:
                    results.append(
                        {
                            "title": r.title,
                            "authors": [a.name for a in r.authors],
                            "summary": r.summary[:500] + "..."
                            if len(r.summary) > 500
                            else r.summary,
                            "pdf_url": r.pdf_url,
                            "published_date": r.published.strftime("%Y-%m-%d"),
                            "similarity_score": round(similarity, 3),
                            "arxiv_id": r.entry_id.split("/")[-1],
                        }
                    )
    
            # Sort by similarity score and limit results
            results.sort(key=lambda x: x["similarity_score"], reverse=True)
            results = results[:max_results]
    
            return {
                "reference_title": paper_title,
                "keywords_used": keywords,
                "similarity_threshold": similarity_threshold,
                "total_related_found": len(results),
                "related_papers": results,
            }
    
        except Exception as e:
            return {"error": f"Failed to find related papers: {str(e)}"}
  • Async handler function implementing the 'find_related_papers' tool in the remote version. Identical logic to the sync version, extracts keywords from input paper title, searches arXiv, filters by similarity threshold, and returns related papers.
    @mcp.tool
    async def find_related_papers(
        paper_title: str,
        max_results: int = 10,
        similarity_threshold: float = 0.7,
        category: str | None = None,
    ) -> dict:
        """
        Find papers related to a given paper title using keyword similarity.
    
        :param paper_title: Title of the reference paper
        :param max_results: Maximum number of related papers to return
        :param similarity_threshold: Minimum similarity score (0.0 to 1.0)
        :param category: Optional category filter
        """
        try:
            # Extract keywords from the title
            stop_words = {
                "a",
                "an",
                "and",
                "the",
                "of",
                "in",
                "for",
                "to",
                "with",
                "on",
                "is",
                "are",
                "was",
                "were",
                "it",
            }
    
            keywords = [
                word.lower()
                for word in re.findall(r"\b\w+\b", paper_title)
                if word.lower() not in stop_words and len(word) > 2
            ]
    
            if not keywords:
                return {"error": "No meaningful keywords found in title"}
    
            # Create search query from keywords
            keyword_query = " OR ".join([f'(ti:"{kw}" OR abs:"{kw}")' for kw in keywords])
            query_parts = [f"({keyword_query})"]
    
            if category:
                query_parts.append(f"cat:{category}")
    
            final_query = " AND ".join(query_parts)
    
            # Search for related papers
            search = arxiv.Search(
                query=final_query,
                max_results=max_results * 2,  # Get more results to filter by similarity
                sort_by=arxiv.SortCriterion.Relevance,
                sort_order=arxiv.SortOrder.Descending,
            )
    
            results = []
    
            for r in search.results():
                # Calculate simple similarity based on keyword overlap
                paper_text = f"{r.title} {r.summary}".lower()
    
                # Count keyword matches
                matches = sum(1 for kw in keywords if kw in paper_text)
                similarity = matches / len(keywords) if keywords else 0
    
                if similarity >= similarity_threshold:
                    results.append(
                        {
                            "title": r.title,
                            "authors": [a.name for a in r.authors],
                            "summary": r.summary[:500] + "..."
                            if len(r.summary) > 500
                            else r.summary,
                            "pdf_url": r.pdf_url,
                            "published_date": r.published.strftime("%Y-%m-%d"),
                            "similarity_score": round(similarity, 3),
                            "arxiv_id": r.entry_id.split("/")[-1],
                        }
                    )
    
            # Sort by similarity score and limit results
            results.sort(key=lambda x: x["similarity_score"], reverse=True)
            results = results[:max_results]
    
            return {
                "reference_title": paper_title,
                "keywords_used": keywords,
                "similarity_threshold": similarity_threshold,
                "total_related_found": len(results),
                "related_papers": results,
            }
    
        except Exception as e:
            return {"error": f"Failed to find related papers: {str(e)}"}
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the core functionality but lacks critical details: it doesn't specify whether this is a read-only operation, what data sources are used, potential rate limits, authentication requirements, or how similarity is calculated (e.g., algorithm, keyword extraction method). The description is insufficient for a tool with 4 parameters and no annotation coverage.

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 efficiently structured with a clear purpose statement followed by well-organized parameter explanations. Each sentence serves a specific function: the first defines the tool's core functionality, and the subsequent lines document parameters without redundancy. The text is front-loaded with the most important information and wastes no words.

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 that there's an output schema (which handles return values), no annotations, and 4 parameters with 0% schema description coverage, the description does an adequate job explaining parameters but falls short on behavioral context. It covers the basic 'what' but lacks the 'how' and operational constraints needed for a tool that performs similarity-based searches. The presence of an output schema prevents this from being a lower score.

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

Parameters4/5

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

The description includes parameter documentation with ':param' annotations that explain each parameter's purpose, which adds significant value beyond the input schema (which has 0% description coverage). It clarifies that 'paper_title' is the reference paper, 'max_results' controls output quantity, 'similarity_threshold' defines a minimum score range, and 'category' is an optional filter. However, it doesn't explain what 'similarity score' means in practice or provide examples of valid categories.

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: 'Find papers related to a given paper title using keyword similarity.' It specifies the verb ('find'), resource ('papers'), and mechanism ('keyword similarity'), but doesn't explicitly differentiate it from sibling tools like 'search_papers' or 'search_by_author' beyond mentioning the specific input approach.

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 'search_papers' (which might search by broader criteria) or 'get_paper_details' (which might retrieve specific paper metadata), leaving the agent to infer usage context from the tool name alone.

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/emi-dm/Arxiv-MCP'

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