Skip to main content
Glama

search_papers

Search academic papers on arXiv using queries, categories, authors, titles, or abstracts, with customizable sorting and pagination options.

Instructions

Search for papers on arXiv by various criteria

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoGeneral search query across all fields
categoryNoarXiv category (e.g., cs.AI, physics.optics)
authorNoAuthor name
titleNoWords in the title
abstractNoWords in the abstract
startNoStarting index for pagination (0-based)
max_resultsNoMaximum number of results to return (max 2000)
sort_byNoSort by: relevance, lastUpdatedDate, submittedDate
sort_orderNoSort order: ascending or descending

Implementation Reference

  • The primary handler function that implements the 'search_papers' tool logic. Builds arXiv API search parameters from input arguments and delegates to queryArxiv for execution.
    public async searchPapers(args: SearchPapersArgs) { const searchParams: SearchParams = {}; // Build search query const searchTerms: string[] = []; if (args.query) { searchTerms.push(`all:${args.query}`); } if (args.category) { searchTerms.push(`cat:${args.category}`); } if (args.author) { searchTerms.push(`au:${args.author}`); } if (args.title) { searchTerms.push(`ti:${args.title}`); } if (args.abstract) { searchTerms.push(`abs:${args.abstract}`); } if (searchTerms.length > 0) { searchParams.search_query = searchTerms.join('+AND+'); } // Add pagination if (args.start !== undefined) { searchParams.start = args.start; } if (args.max_results !== undefined) { searchParams.max_results = Math.min(args.max_results, 2000); // API limit } else { searchParams.max_results = 10; // Default } // Add sorting if (args.sort_by) { searchParams.sortBy = args.sort_by; } if (args.sort_order) { searchParams.sortOrder = args.sort_order; } const response = await this.queryArxiv(searchParams); return { content: [ { type: 'text', text: JSON.stringify(response, null, 2), }, ], }; }
  • src/index.ts:108-154 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining name, description, and JSON input schema for 'search_papers'.
    { name: 'search_papers', description: 'Search for papers on arXiv by various criteria', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'General search query across all fields', }, category: { type: 'string', description: 'arXiv category (e.g., cs.AI, physics.optics)', }, author: { type: 'string', description: 'Author name', }, title: { type: 'string', description: 'Words in the title', }, abstract: { type: 'string', description: 'Words in the abstract', }, start: { type: 'number', description: 'Starting index for pagination (0-based)', }, max_results: { type: 'number', description: 'Maximum number of results to return (max 2000)', }, sort_by: { type: 'string', description: 'Sort by: relevance, lastUpdatedDate, submittedDate', enum: ['relevance', 'lastUpdatedDate', 'submittedDate'], }, sort_order: { type: 'string', description: 'Sort order: ascending or descending', enum: ['ascending', 'descending'], }, }, }, },
  • TypeScript interface defining the expected input shape for the searchPapers handler.
    interface SearchPapersArgs { query?: string; category?: string; author?: string; title?: string; abstract?: string; start?: number; max_results?: number; sort_by?: string; sort_order?: string; }
  • Dispatch handler in CallToolRequestSchema that routes 'search_papers' calls to the searchPapers method.
    case 'search_papers': return await this.searchPapers(request.params.arguments as unknown as SearchPapersArgs);

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/Mnehmos/mnehmos.arxiv.mcp'

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