Skip to main content
Glama

load_article_to_context

Load arXiv article content into LLM context by searching with the article title, enabling analysis of scholarly papers.

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
NameRequiredDescriptionDefault
titleYes

Implementation Reference

  • The handler function decorated with @mcp.tool(), implementing the core logic: searches arXiv by title, downloads PDF, extracts full text using PyMuPDF (fitz), and returns the article content as a string.
    @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

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/prashalruchiranga/arxiv-mcp-server'

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