Skip to main content
Glama
lingqukan

arXiv MCP Server

by lingqukan

count_papers_on_date

Check how many arXiv papers were published in a specific category on a given date to determine appropriate batch sizes for fetching.

Instructions

Count how many papers were published in an arXiv category on a specific date.

Use this before fetch_papers to check the volume of papers for a given day,
so you can decide how many to fetch with fetch_papers(max_results=N).

Args:
    category: arXiv category (e.g. "cs.AI", "cs.CL", "stat.ML")
    date: Date in YYYY-MM-DD format (e.g. "2026-03-18")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYes
dateYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler for count_papers_on_date, which registers the tool and calls the helper function.
    @mcp.tool()
    def count_papers_on_date(category: str, date: str) -> str:
        """Count how many papers were published in an arXiv category on a specific date.
    
        Use this before fetch_papers to check the volume of papers for a given day,
        so you can decide how many to fetch with fetch_papers(max_results=N).
    
        Args:
            category: arXiv category (e.g. "cs.AI", "cs.CL", "stat.ML")
            date: Date in YYYY-MM-DD format (e.g. "2026-03-18")
        """
        logger.info(f"Counting papers: category={category}, date={date}")
        count = count_papers(category, date)
        return json.dumps(
            {
                "category": category,
                "date": date,
                "count": count,
                "suggestion": f"Use fetch_papers(category='{category}', num_days=1, max_results={count}) to fetch them all.",
            },
  • The core implementation of the paper counting logic, utilizing the arxiv API client.
    def count_papers(category: str, date: str, max_results: int = 500) -> int:
        """Count papers published on a specific date via the arXiv API.
    
        Uses date range in the query to avoid scanning unrelated papers.
    
        Args:
            category: arXiv category (e.g. "cs.AI", "cs.CL")
            date: Date string in YYYY-MM-DD format
            max_results: Maximum number of papers to count (default: 500)
    
        Returns:
            Number of papers published on that date (capped at max_results).
        """
        target_date = datetime.fromisoformat(date).date()
        next_date = target_date + timedelta(days=1)
        date_str = target_date.strftime("%Y%m%d")
        next_str = next_date.strftime("%Y%m%d")
    
        search = Search(
            query=f"cat:{category} AND submittedDate:[{date_str}0000 TO {next_str}0000]",
            sort_by=SortCriterion.SubmittedDate,
            sort_order=SortOrder.Descending,
        )
    
        client = Client()
        count = 0
        for _ in client.results(search):
            count += 1
            if count >= max_results:
Behavior4/5

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

With no annotations provided, the description carries the full burden. It implies this is a safe read operation (counting) and clarifies its role in the workflow chain. However, it doesn't explicitly state error conditions, rate limits, or the exact return type (though output schema exists to cover the latter).

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?

Front-loaded with purpose statement, followed by usage context, then structured Args documentation. Every sentence earns its place; no tautology or repetition of the tool name. Appropriate length for the complexity.

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

Completeness5/5

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

Given 2 simple flat parameters and the existence of an output schema (mentioned in context signals), the description is complete. It covers purpose, usage sequencing, and parameter semantics without gaps.

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?

Critical compensation for 0% schema description coverage. The Args section adds essential semantics: category includes valid arXiv examples (cs.AI, cs.CL, stat.ML) and date specifies YYYY-MM-DD format with a clear example—information completely absent from the raw schema.

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?

The description opens with a specific verb (Count) + resource (papers) + precise scope scope (arXiv category on specific date). It clearly distinguishes from sibling fetch_papers by emphasizing this only returns a count, not the papers themselves.

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 prescribes when to use ('before fetch_papers') and why ('to check the volume... so you can decide how many to fetch'). Names the sibling alternative directly and establishes the workflow dependency clearly.

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