load_article_to_context
Load arXiv.org article content into LLM context by searching for the article title, enabling enhanced interaction with scholarly resources.
Instructions
Load the article hosted on arXiv.org into context. This tool searches for the article based on its title, retrieves the article content, and loads text content into LLM context.
Args: title: Article title.
Returns: Article as a text string or error message.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes |
Implementation Reference
- src/arxiv_server/server.py:155-178 (handler)The handler function implementing the 'load_article_to_context' tool. It resolves the arXiv article URL from the title, downloads the PDF, extracts text from all pages using PyMuPDF (fitz), and returns the full text content.@mcp.tool() async def load_article_to_context(title: str) -> str: """ Load the article hosted on arXiv.org into context. This tool searches for the article based on its title, retrieves the article content, and loads text content into LLM context. Args: title: Article title. Returns: Article as a text string or error message. """ result = await get_url_and_arxiv_id(title) if isinstance(result, str): return result article_url, _ = result pdf_doc = await get_pdf(article_url) if pdf_doc is None: return "Unable to retrieve the article from arXiv.org." pymupdf_doc = fitz.open(stream=pdf_doc, filetype="pdf") content = "" for page in pymupdf_doc: content += page.get_text() return content