Skip to main content
Glama
lingqukan

arXiv MCP Server

by lingqukan

fetch_papers

Retrieve recent arXiv research papers by category, date, or time period and store them locally for efficient access to titles and metadata.

Instructions

Fetch recent papers from arXiv API and store them in the local database.

Returns only fetched paper titles (not abstracts) to save context.
Use query_papers(entry_ids=[...], fields=["abstract"]) to retrieve abstracts for specific papers.

Args:
    category: arXiv category (e.g. "cs.AI", "cs.CL", "stat.ML")
    date: Fetch papers published on a specific date in YYYY-MM-DD format.
          When provided, takes priority over num_days.
    num_days: Number of days to look back (default: 3). Ignored when date is set.
    max_results: Maximum number of papers to fetch (default: 100)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYes
dateNo
num_daysNo
max_resultsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the `fetch_papers` MCP tool, which retrieves papers from arXiv and saves them to the database.
    @mcp.tool()
    def fetch_papers(
        category: str, date: Optional[str] = None, num_days: int = 3, max_results: int = 100
    ) -> str:
        """Fetch recent papers from arXiv API and store them in the local database.
    
        Returns only fetched paper titles (not abstracts) to save context.
        Use query_papers(entry_ids=[...], fields=["abstract"]) to retrieve abstracts for specific papers.
    
        Args:
            category: arXiv category (e.g. "cs.AI", "cs.CL", "stat.ML")
            date: Fetch papers published on a specific date in YYYY-MM-DD format.
                  When provided, takes priority over num_days.
            num_days: Number of days to look back (default: 3). Ignored when date is set.
            max_results: Maximum number of papers to fetch (default: 100)
        """
        logger.info(
            f"Fetching papers: category={category}, date={date}, days={num_days}, max={max_results}"
        )
        papers = download_papers(category, num_days, max_results, date=date)
        db = _get_db()
        db.save_papers(papers)
        result: dict = {"status": "ok", "category": category, "papers_fetched": len(papers)}
        if date is not None:
            result["date"] = date
        else:
            result["num_days"] = num_days
        return json.dumps(result, ensure_ascii=False, indent=2)
Behavior4/5

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

With no annotations provided, description carries full burden. It successfully discloses: (1) persistence side-effect ('store them in local database'), (2) limited return format ('Returns only fetched paper titles'), and (3) external API dependency ('arXiv API'). Missing minor details like rate limits or duplicate handling, but covers major behavioral traits.

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?

Well-structured with 3 front-loaded prose sentences covering purpose, output, and alternatives, followed by Args section. Given 0% schema coverage, the Args block is necessary and earns its place. Slight verbosity from redundant 'Args:' header but acceptable given constraints.

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?

Appropriate for a 4-parameter tool with output schema: description clarifies the storage mutation and return limitation without needing to replicate output schema details. Workflow guidance covers the gap between fetch_papers and query_papers.

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

Parameters5/5

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

Schema description coverage is 0%, requiring description to compensate completely. The Args section documents all 4 parameters with rich semantics: category includes examples ('cs.AI'), date includes format (YYYY-MM-DD) and priority logic ('takes priority over'), num_days includes default (3) and interaction ('Ignored when date is set').

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?

Excellent specificity: verb 'Fetch', resource 'papers from arXiv API', scope 'recent', and critical side-effect 'store them in the local database'. Effectively distinguishes from sibling query_papers by noting this tool stores to database while query_papers retrieves specific fields.

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

Usage Guidelines5/5

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

Explicitly names alternative tool with specific syntax: 'Use query_papers(entry_ids=[...], fields=["abstract"]) to retrieve abstracts'. This provides clear workflow guidance (fetch first, then query) and indicates when to use the sibling instead.

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/lingqukan/arxiv-today-mcp'

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