Skip to main content
Glama

get_article_url

Retrieve the URL of an arXiv.org article by providing its title. This tool searches arXiv.org and returns the direct link to the article for quick access and reference.

Instructions

Retrieve the URL of an article hosted on arXiv.org based on its title. Use this tool only for retrieving the URL. This tool searches for the article based on its title, and then fetches the corresponding URL from arXiv.org.

Args: title: Article title.

Returns: URL that can be used to retrieve the article.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes

Implementation Reference

  • The handler function for the 'get_article_url' tool. It is decorated with @mcp.tool() for registration and implements the core logic: searches arXiv using the title, retrieves the PDF URL, or returns an error message.
    @mcp.tool() async def get_article_url(title: str) -> str: """ Retrieve the URL of an article hosted on arXiv.org based on its title. Use this tool only for retrieving the URL. This tool searches for the article based on its title, and then fetches the corresponding URL from arXiv.org. Args: title: Article title. Returns: URL that can be used to retrieve the article. """ result = await get_url_and_arxiv_id(title) if isinstance(result, str): return result article_url, _ = result return article_url
  • Key helper function called by the handler to fetch article information from arXiv API and construct the direct PDF URL and arXiv ID.
    async def get_url_and_arxiv_id(title: str) -> tuple[str, str] | str: """Get URL of the article hosted on arXiv.org.""" info = await fetch_information(title) if isinstance(info, str): return info arxiv_id = info.id.split("/abs/")[-1] direct_pdf_url = f"https://arxiv.org/pdf/{arxiv_id}" return (direct_pdf_url, arxiv_id)
  • Helper function that queries the arXiv API with the formatted title, parses the feed, finds the best matching entry using fuzzy matching, and returns the entry or error.
    async def fetch_information(title: str): """Get information about the article.""" formatted_title = format_text(title) url = f"{ARXIV_API_BASE}/query" params = { "search_query": f'ti:{formatted_title}', "start": 0, "max_results": 25 } data = await make_api_call(url, params=params) if data is None: return "Unable to retrieve data from arXiv.org." feed = feedparser.parse(data) error_msg = ( "Unable to extract information for the provided title. " "This issue may stem from an incorrect or incomplete title, " "or because the work has not been published on arXiv." ) if not feed.entries: return error_msg best_match = find_best_match(target_title=formatted_title, entries=feed.entries) if best_match is None: return str(error_msg) return best_match

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