Skip to main content
Glama

search_crossref

Search academic papers using Crossref's database to find scholarly metadata across publishers with filters for query, year, author, and sorting options.

Instructions

Search academic papers from Crossref database. Free API with extensive scholarly metadata coverage across publishers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query string
maxResultsNoMaximum number of results to return
yearNoYear filter (e.g., "2023", "2020-2023")
authorNoAuthor name filter
sortByNoSort results by relevance, date, or citations
sortOrderNoSort order: ascending or descending

Implementation Reference

  • The main handler for the search_crossref tool. Parses arguments, calls the CrossrefSearcher's search method, formats results as JSON text response.
    case 'search_crossref': { const { query, maxResults, year, author, sortBy, sortOrder } = args; const results = await searchers.crossref.search(query, { maxResults, year, author, sortBy, sortOrder }); return jsonTextResponse( `Found ${results.length} Crossref papers.\n\n${JSON.stringify( results.map((paper: Paper) => PaperFactory.toDict(paper)), null, 2 )}` ); }
  • Zod schema defining input validation for search_crossref tool arguments. Used in parseToolArgs.
    export const SearchCrossrefSchema = z .object({ query: z.string().min(1), maxResults: z.number().int().min(1).max(100).optional().default(10), year: z.string().optional(), author: z.string().optional(), sortBy: SortBySchema.optional().default('relevance'), sortOrder: SortOrderSchema.optional().default('desc') }) .strip();
  • Tool registration entry in the TOOLS array exported for MCP server tool listing.
    { name: 'search_crossref', description: 'Search academic papers from Crossref database. Free API with extensive scholarly metadata coverage across publishers.', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query string' }, 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")' }, author: { type: 'string', description: 'Author name filter' }, 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'] } }
  • Core search implementation in CrossrefSearcher class. Constructs API parameters, makes HTTP request to Crossref API, parses response into Paper objects.
    async search(query: string, options: SearchOptions = {}): Promise<Paper[]> { const maxResults = Math.min(options.maxResults || 10, 1000); const params: Record<string, any> = { query: query, rows: maxResults, mailto: this.mailto }; // Build filters const filters: string[] = []; // Year filter if (options.year) { const yearMatch = options.year.match(/^(\d{4})(?:-(\d{4})?)?$/); if (yearMatch) { const startYear = yearMatch[1]; const endYear = yearMatch[2] || startYear; if (startYear) { filters.push(`from-pub-date:${startYear}`); } if (endYear && endYear !== startYear) { filters.push(`until-pub-date:${endYear}`); } } } // Add filters if (filters.length > 0) { params.filter = filters.join(','); } // Sorting const sortMapping: Record<string, string> = { 'relevance': 'relevance', 'date': 'published', 'citations': 'is-referenced-by-count' }; params.sort = sortMapping[options.sortBy || 'relevance'] || 'relevance'; params.order = options.sortOrder === 'asc' ? 'asc' : 'desc'; try { const response = await this.client.get('', { params }); if (response.status === 200 && response.data?.message?.items) { return this.parseSearchResponse(response.data); } return []; } catch (error: any) { this.handleHttpError(error, 'search'); } }
  • Initializes the CrossrefSearcher instance as part of the global searchers object used by tool handlers.
    const crossrefSearcher = new CrossrefSearcher(process.env.CROSSREF_MAILTO);
  • src/server.ts:57-60 (registration)
    Registers the tool list handler in the MCP server, returning the TOOLS array including search_crossref.
    server.setRequestHandler(ListToolsRequestSchema, async () => { logDebug('Received tools/list request'); return { tools: TOOLS }; });

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/Dianel555/paper-search-mcp-nodejs'

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