Skip to main content
Glama
salwks

mcp-techTrend

arxiv_recent

Read-only

Fetch recent arXiv papers in a specified category, ordered by submission date. Customize search with recency filter and result limit.

Instructions

Fetch recent arXiv papers in a category, sorted by submission date (newest first). days filters by published date.

Common categories: cs.AI (general AI), cs.LG (machine learning), cs.CV (computer vision), cs.CL (NLP), cs.HC (HCI / UX), cs.RO (robotics), cs.NE (neural networks), stat.ML (statistical ML), eess.IV (image/video processing — medical imaging lives here), eess.SP (signal processing), q-bio.QM (quantitative biology).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYes
daysNo
max_resultsNo
response_formatNomarkdown

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • trends_mcp.py:350-368 (registration)
    The @_maybe_tool decorator registers the 'arxiv_recent' tool with FastMCP when the 'arxiv' source is enabled. It sets the tool name, description with common arXiv categories, and read-only annotations.
    @_maybe_tool(
        source="arxiv",
        name="arxiv_recent",
        description=(
            "Fetch recent arXiv papers in a category, sorted by submission date "
            "(newest first). `days` filters by `published` date.\n\n"
            "Common categories: cs.AI (general AI), cs.LG (machine learning), "
            "cs.CV (computer vision), cs.CL (NLP), cs.HC (HCI / UX), "
            "cs.RO (robotics), cs.NE (neural networks), stat.ML (statistical ML), "
            "eess.IV (image/video processing — medical imaging lives here), "
            "eess.SP (signal processing), q-bio.QM (quantitative biology)."
        ),
        annotations={
            "readOnlyHint": True,
            "destructiveHint": False,
            "openWorldHint": True,
            "idempotentHint": False,
        },
    )
  • The arxiv_recent async function implements the tool logic: validates input via ArxivRecentInput model, queries arXiv API for papers by category sorted by submission date, filters by the specified days window, and formats results as Markdown or JSON.
    async def arxiv_recent(
        category: str,
        days: int = 7,
        max_results: int = 20,
        response_format: ResponseFormat = ResponseFormat.MARKDOWN,
    ) -> str:
        try:
            args = ArxivRecentInput(
                category=category,
                days=days,
                max_results=max_results,
                response_format=response_format,
            )
            # Over-fetch because arXiv has no native date filter.
            fetch_n = min(args.max_results * 3, 100)
            params = {
                "search_query": f"cat:{args.category}",
                "sortBy": "submittedDate",
                "sortOrder": "descending",
                "start": 0,
                "max_results": fetch_n,
            }
            text = await _http_get_text(ARXIV_API, params=params, ttl=TTL_DEFAULT)
            papers = _parse_arxiv_atom(text)
            cutoff = _utc_now() - timedelta(days=args.days)
            filtered: list[dict[str, Any]] = []
            for p in papers:
                try:
                    pub_dt = datetime.fromisoformat(p["published"].replace("Z", "+00:00"))
                except ValueError:
                    continue
                if pub_dt >= cutoff:
                    filtered.append(p)
                if len(filtered) >= args.max_results:
                    break
            header = f"arXiv `{args.category}` — 최근 {args.days}일 ({len(filtered)}건)"
            return _format(filtered, args.response_format, render_md=lambda x: _render_arxiv_md(x, header))
        except Exception as e:
            return _handle_error(e, "arxiv_recent")
  • ArxivRecentInput Pydantic model defines the input schema: 'category' (min 2, max 40 chars), 'days' (1-30, default 7), 'max_results' (1-50, default 20), and 'response_format' (markdown/json).
    class ArxivRecentInput(BaseModel):
        model_config = ConfigDict(str_strip_whitespace=True, extra="forbid")
        category: str = Field(..., min_length=2, max_length=40, description="arXiv category, e.g. cs.AI, cs.HC, eess.IV")
        days: int = Field(7, ge=1, le=30)
        max_results: int = Field(20, ge=1, le=50)
        response_format: ResponseFormat = ResponseFormat.MARKDOWN
  • _parse_arxiv_atom parses the arXiv Atom XML response into a list of paper dicts with id, url, title, summary, published, updated, authors, and primary_category.
    def _parse_arxiv_atom(xml_text: str) -> list[dict[str, Any]]:
        root = ET.fromstring(xml_text)
        out: list[dict[str, Any]] = []
        for entry in root.findall("atom:entry", ATOM_NS):
            eid = (entry.findtext("atom:id", default="", namespaces=ATOM_NS) or "").strip()
            title = (entry.findtext("atom:title", default="", namespaces=ATOM_NS) or "").strip()
            summary = (entry.findtext("atom:summary", default="", namespaces=ATOM_NS) or "").strip()
            published = (entry.findtext("atom:published", default="", namespaces=ATOM_NS) or "").strip()
            updated = (entry.findtext("atom:updated", default="", namespaces=ATOM_NS) or "").strip()
            authors = [
                (a.findtext("atom:name", default="", namespaces=ATOM_NS) or "").strip()
                for a in entry.findall("atom:author", ATOM_NS)
            ]
            cats = [
                c.attrib.get("term", "")
                for c in entry.findall("{http://arxiv.org/schemas/atom}primary_category")
            ]
            # Extract arXiv id from URL like http://arxiv.org/abs/2604.12345v1
            arxiv_id = eid.rsplit("/", 1)[-1] if eid else ""
            out.append(
                {
                    "id": arxiv_id,
                    "url": eid,
                    "title": title,
                    "summary": summary,
                    "published": published,
                    "updated": updated,
                    "authors": authors,
                    "primary_category": cats[0] if cats else "",
                }
            )
        return out
  • _render_arxiv_md renders a list of arXiv papers into a Markdown-formatted string with numbered entries, links, author lists, and truncated abstracts.
    def _render_arxiv_md(papers: list[dict[str, Any]], header: str) -> str:
        if not papers:
            return f"# {header}\n\n_결과 없음_"
        lines = [f"# {header}", f"_총 {len(papers)}건_", ""]
        for i, p in enumerate(papers, 1):
            authors = ", ".join(p["authors"][:4])
            if len(p["authors"]) > 4:
                authors += f" 외 {len(p['authors']) - 4}명"
            lines.append(
                f"## {i}. [{p['title']}]({p['url']})\n"
                f"- `{p['id']}` · {p['primary_category']} · {_fmt_date(p['published'])}\n"
                f"- 저자: {authors}\n"
                f"- {_trim(p['summary'], 500)}\n"
            )
        return "\n".join(lines)
Behavior4/5

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

The description adds behavioral context beyond annotations by specifying that results are sorted by submission date (newest first) and that 'days' filters by 'published' date. This aligns with the readOnlyHint annotation.

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 concise, with the first sentence clearly stating the purpose, followed by a useful list of common categories. No wasted words.

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?

For a 4-parameter tool with an output schema, the description covers the key parameters 'category' and 'days' but omits 'max_results' and 'response_format'. However, the defaults and simple types make this reasonably complete.

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?

The description adds meaning for the 'days' parameter (filters by published date) and provides common categories, but does not explain 'max_results' or 'response_format'. With 0% schema coverage, this partial compensation yields a middle score.

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 uses a specific verb 'Fetch' and resource 'recent arXiv papers in a category' with sorting by submission date. It clearly distinguishes from sibling tools like 'arxiv_search' which is for searching rather than recent papers.

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

Usage Guidelines4/5

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

The description states the tool fetches recent papers and explains the 'days' parameter filters by published date. It does not explicitly mention when not to use it, but the context of sibling names implies it is for recent papers only.

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/salwks/mcp-techTrend'

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