Skip to main content
Glama

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

Implementation Reference

  • 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

Other Tools

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

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