search_papers
Search academic papers across multiple platforms like arXiv, PubMed, and Google Scholar to find relevant research publications using customizable filters.
Instructions
Search academic papers from multiple sources including arXiv, Web of Science, etc.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query string | |
| platform | No | Platform to search (default: crossref). Options: arxiv, webofscience/wos, pubmed, biorxiv, medrxiv, semantic, iacr, googlescholar/scholar, scihub, sciencedirect, springer, scopus, crossref, or all. Note: Wiley only supports PDF download by DOI, use download_paper instead. | |
| maxResults | No | Maximum number of results to return | |
| year | No | Year filter (e.g., "2023", "2020-2023", "2020-") | |
| author | No | Author name filter | |
| journal | No | Journal name filter | |
| category | No | Category filter (e.g., cs.AI for arXiv) | |
| days | No | Number of days to search back (bioRxiv/medRxiv only) | |
| fetchDetails | No | Fetch detailed information (IACR only) | |
| fieldsOfStudy | No | Fields of study filter (Semantic Scholar only) | |
| sortBy | No | Sort results by relevance, date, or citations | |
| sortOrder | No | Sort order: ascending or descending |
Implementation Reference
- src/mcp/handleToolCall.ts:28-82 (handler)Handler logic for the 'search_papers' tool. Parses arguments, constructs search options, performs search on specified platform or 'all' with fallback, and returns JSON-formatted results.case 'search_papers': { const { query, platform, maxResults, year, author, journal, category, days, fetchDetails, fieldsOfStudy, sortBy, sortOrder } = args; const results: Record<string, any>[] = []; const searchOptions: SearchOptions = { maxResults, year, author, journal, category, days, fetchDetails, fieldsOfStudy, sortBy, sortOrder }; if (platform === 'all') { try { const platformResults = await searchers.crossref.search(query, searchOptions); results.push(...platformResults.map((paper: Paper) => PaperFactory.toDict(paper))); } catch (error) { logDebug('Error searching crossref:', error); try { const platformResults = await searchers.arxiv.search(query, searchOptions); results.push(...platformResults.map((paper: Paper) => PaperFactory.toDict(paper))); } catch (fallbackError) { logDebug('Error with arxiv fallback:', fallbackError); } } } else { const searcher = (searchers as any)[platform]; if (!searcher) { throw new Error(`Unsupported platform: ${platform}`); } const platformResults = await (searcher as PaperSource).search(query, searchOptions); results.push(...platformResults.map((paper: Paper) => PaperFactory.toDict(paper))); } return jsonTextResponse(`Found ${results.length} papers.\n\n${JSON.stringify(results, null, 2)}`); }
- src/mcp/schemas.ts:6-41 (schema)Zod schema definition for validating input arguments to the 'search_papers' tool, including query, platform options, filters, and sorting.export const SearchPapersSchema = z .object({ query: z.string().min(1), platform: z .enum([ 'arxiv', 'webofscience', 'pubmed', 'wos', 'biorxiv', 'medrxiv', 'semantic', 'iacr', 'googlescholar', 'scholar', 'scihub', 'sciencedirect', 'springer', 'scopus', 'crossref', 'all' ]) .optional() .default('crossref'), maxResults: z.number().int().min(1).max(100).optional().default(10), year: z.string().optional(), author: z.string().optional(), journal: z.string().optional(), category: z.string().optional(), days: z.number().int().min(1).max(3650).optional(), fetchDetails: z.boolean().optional(), fieldsOfStudy: z.array(z.string()).optional(), sortBy: SortBySchema.optional().default('relevance'), sortOrder: SortOrderSchema.optional().default('desc') }) .strip();
- src/mcp/tools.ts:4-70 (registration)MCP tool registration for 'search_papers', including name, description, and input schema definition.{ name: 'search_papers', description: 'Search academic papers from multiple sources including arXiv, Web of Science, etc.', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query string' }, platform: { type: 'string', enum: [ 'arxiv', 'webofscience', 'pubmed', 'wos', 'biorxiv', 'medrxiv', 'semantic', 'iacr', 'googlescholar', 'scholar', 'scihub', 'sciencedirect', 'springer', 'scopus', 'crossref', 'all' ], description: 'Platform to search (default: crossref). Options: arxiv, webofscience/wos, pubmed, biorxiv, medrxiv, semantic, iacr, googlescholar/scholar, scihub, sciencedirect, springer, scopus, crossref, or all. Note: Wiley only supports PDF download by DOI, use download_paper instead.' }, maxResults: { type: 'number', minimum: 1, maximum: 100, description: 'Maximum number of results to return' }, year: { type: 'string', description: 'Year filter (e.g., "2023", "2020-2023", "2020-")' }, author: { type: 'string', description: 'Author name filter' }, journal: { type: 'string', description: 'Journal name filter' }, category: { type: 'string', description: 'Category filter (e.g., cs.AI for arXiv)' }, days: { type: 'number', description: 'Number of days to search back (bioRxiv/medRxiv only)' }, fetchDetails: { type: 'boolean', description: 'Fetch detailed information (IACR only)' }, fieldsOfStudy: { type: 'array', items: { type: 'string' }, description: 'Fields of study filter (Semantic Scholar only)' }, sortBy: { type: 'string', enum: ['relevance', 'date', 'citations'], description: 'Sort results by relevance, date, or citations' }, sortOrder: { type: 'string', enum: ['asc', 'desc'], description: 'Sort order: ascending or descending' } }, required: ['query'] } },