Skip to main content
Glama

list_papers

Retrieve available arXiv papers to search, download, or read scientific research through the MCP interface.

Instructions

List all existing papers available as resources

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main asynchronous handler function that executes the list_papers tool: lists local papers, fetches metadata from arXiv API, formats as JSON.
    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)}")]
  • Defines the MCP Tool object for list_papers, including name, description, and empty input schema (no parameters required).
    list_tool = types.Tool( name="list_papers", description="List all existing papers available as resources", inputSchema={ "type": "object", "properties": {}, "required": [], }, )
  • Registers the list_papers tool schema (via 'list_tool') with the MCP server by including it in the response to list_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]
  • Maps tool name 'list_papers' to its handler function in the server's call_tool dispatcher.
    elif name == "list_papers": return await handle_list_papers(arguments)
  • Helper function that scans the storage directory for downloaded paper markdown files and returns their IDs.
    def list_papers() -> list[str]: """List all stored paper IDs.""" return [p.stem for p in Path(settings.STORAGE_PATH).glob("*.md")]

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/wr-web/APR'

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