Skip to main content
Glama
huanongfish

ArXiv MCP Server

by huanongfish

list_papers

Retrieve available arXiv research papers to access scientific literature for reading or analysis.

Instructions

List all existing papers available as resources

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'list_papers' tool. It lists locally stored paper IDs, fetches metadata from arXiv API, formats as JSON, and returns as TextContent.
    async def handle_list_papers( arguments: Optional[Dict[str, Any]] = None ) -> List[types.TextContent]: """Handle requests to list all stored papers.""" try: papers = list_papers() client = arxiv.Client() results = client.results(arxiv.Search(id_list=papers)) response_data = { "total_papers": len(papers), "papers": [ { "title": result.title, "summary": result.summary, "authors": [author.name for author in result.authors], "links": [link.href for link in result.links], "pdf_url": result.pdf_url, } for result in results ], } return [ types.TextContent(type="text", text=json.dumps(response_data, indent=2)) ] except Exception as e: return [types.TextContent(type="text", text=f"Error: {str(e)}")]
  • Schema definition for the list_papers tool, specifying name, description, and an empty input schema (no required parameters).
    list_tool = types.Tool( name="list_papers", description="List all existing papers available as resources", inputSchema={ "type": "object", "properties": {}, "required": [], }, )
  • Helper utility to retrieve list of stored paper IDs by scanning Markdown files in the storage directory.
    def list_papers() -> list[str]: """List all stored paper IDs.""" return [p.stem for p in Path(settings.STORAGE_PATH).glob("*.md")]
  • Registration via list_tools() method, which includes 'list_tool' in the returned list of available tools.
    @server.list_tools() async def list_tools() -> List[types.Tool]: """List available arXiv research tools.""" return [search_tool, download_tool, list_tool, read_tool]
  • Tool dispatch registration in the call_tool() handler, routing 'list_papers' calls to handle_list_papers.
    elif name == "list_papers": return await handle_list_papers(arguments)

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

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