get_details
Fetch detailed metadata of arXiv articles by title, including arXiv ID, authors, summary, PDF link, and timestamps. Returns JSON-formatted data for easy integration.
Instructions
Retrieve information of an article hosted on arXiv.org based on its title. This tool searches for the article based on its title and retrieves arXiv ID, title, authors, link, direct PDF URL, published timestamp, last updated timestamp, and summary.
Args: title: Article title.
Returns: A JSON-formatted string containing article details if retrieval is successful; otherwise, a plain error message string.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes |
Implementation Reference
- src/arxiv_server/server.py:180-217 (handler)The main handler function for the 'get_details' tool. It fetches arXiv article information using fetch_information helper, extracts details like ID, title, authors, etc., and returns them as a JSON string. Includes input schema in docstring and is registered via @mcp.tool() decorator.@mcp.tool() async def get_details(title: str) -> str: """ Retrieve information of an article hosted on arXiv.org based on its title. This tool searches for the article based on its title and retrieves arXiv ID, title, authors, link, direct PDF URL, published timestamp, last updated timestamp, and summary. Args: title: Article title. Returns: A JSON-formatted string containing article details if retrieval is successful; otherwise, a plain error message string. """ info = await fetch_information(title) if isinstance(info, str): return info id = info.id link = info.link article_title = info.title authors = [author['name'] for author in info.authors] arxiv_id = id.split("/abs/")[-1] direct_pdf_url = f"https://arxiv.org/pdf/{arxiv_id}" updated = getattr(info, "updated", "Unknown") published = getattr(info, "published", "Unknown") summary = getattr(info, "summary", "Unknown") info_dict = { "arXiv ID": arxiv_id, "Title": article_title, "Authors": authors, "Link": link, "Direct PDF URL": direct_pdf_url, "Published": published, "Updated": updated, "Summary": summary } return json.dumps(info_dict)