ArxivSearchTool (tools/paper_search_tool.py)

DeepTutor · deeptutor/tools/paper_search_tool.py · python · Apache-2.0
search, ai

Searches arXiv for papers and returns metadata for use in chat tools.

# Source: https://github.com/HKUDS/DeepTutor | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""
ArXiv search tool for preprint discovery.

This utility searches arXiv and returns lightweight metadata suitable for
tool usage in chat flows.
"""

import asyncio
from datetime import datetime
import logging
import re

import arxiv

logger = logging.getLogger(__name__)

_FETCH_MULTIPLIER = 2
_MAX_FETCH_CAP = 30
_REQUEST_TIMEOUT_S = 30
_MAX_RETRIES = 2
_RETRY_DELAY_S = 3.0


class ArxivSearchTool:
    """Search arXiv preprints and return normalized metadata."""

    def __init__(self):
        """Initialize search tool"""
        self.client = arxiv.Client(
            page_size=20,
    

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key