Skip to main content
Glama
Dianel555

Paper Search MCP

by Dianel555

search_sciencedirect

Search academic papers from Elsevier's ScienceDirect database to find relevant research articles using filters for year, author, journal, and open access status.

Instructions

Search academic papers from Elsevier ScienceDirect database (requires API key)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query string
maxResultsNoMaximum number of results to return
yearNoYear filter (e.g., "2023", "2020-2023")
authorNoAuthor name filter
journalNoJournal name filter
openAccessNoFilter for open access articles only

Implementation Reference

  • The handler function for the 'search_sciencedirect' tool. It validates the Elsevier API key, calls the ScienceDirect searcher's search method with provided parameters, and returns a formatted JSON response with search results.
    case 'search_sciencedirect': {
      const { query, maxResults, year, author, journal, openAccess } = args;
      if (!process.env.ELSEVIER_API_KEY) {
        throw new Error('Elsevier API key not configured. Please set ELSEVIER_API_KEY environment variable.');
      }
      const results = await searchers.sciencedirect.search(query, {
        maxResults,
        year,
        author,
        journal,
        openAccess
      });
    
      return jsonTextResponse(
        `Found ${results.length} ScienceDirect papers.\n\n${JSON.stringify(
          results.map((paper: Paper) => PaperFactory.toDict(paper)),
          null,
          2
        )}`
      );
    }
  • Zod schema definition for validating input arguments to the search_sciencedirect tool.
    export const SearchScienceDirectSchema = 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(),
        journal: z.string().optional(),
        openAccess: z.boolean().optional()
      })
      .strip();
  • Tool registration entry in the tools array, defining name, description, and input schema for the MCP tool.
      name: 'search_sciencedirect',
      description: 'Search academic papers from Elsevier ScienceDirect database (requires API key)',
      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' },
          journal: { type: 'string', description: 'Journal name filter' },
          openAccess: {
            type: 'boolean',
            description: 'Filter for open access articles only'
          }
        },
        required: ['query']
      }
    },
  • Core implementation of the search functionality in ScienceDirectSearcher class, handling API requests to Elsevier's ScienceDirect, parsing responses, and creating Paper objects.
    async search(query: string, options: SearchOptions = {}): Promise<Paper[]> {
      const customOptions = options as any;
      if (!this.apiKey) {
        throw new Error('ScienceDirect API key is required');
      }
    
      const maxResults = Math.min(options.maxResults || 10, 100);
      const papers: Paper[] = [];
    
      try {
        // Use PUT method with new API format (matching Python implementation)
        const requestBody: any = {
          qs: query
        };
    
        // Add year filter
        if (options.year) {
          if (options.year.includes('-')) {
            const [startYear, endYear] = options.year.split('-');
            requestBody.date = endYear ? `${startYear}-${endYear}` : startYear;
          } else {
            requestBody.date = options.year;
          }
        }
    
        // Add author filter
        if (options.author) {
          requestBody.authors = options.author;
        }
    
        // Display options
        requestBody.display = {
          offset: 0,
          show: maxResults,
          sortBy: options.sortBy === 'date' ? 'date' : 'relevance'
        };
    
        await this.rateLimiter.waitForPermission();
    
        const response = await this.client.put('/content/search/sciencedirect', requestBody, {
          headers: {
            'Content-Type': 'application/json'
          }
        });
    
        const results = response.data?.results || [];
    
        for (const result of results) {
          const paper = this.parseNewApiResult(result);
          if (paper) {
            papers.push(paper);
          }
        }
    
        // Enrich with abstracts if requested
        if (customOptions.includeAbstract && papers.length > 0) {
          const enrichedPapers = await this.enrichPapersWithAbstracts(papers);
          return enrichedPapers;
        }
    
        return papers;
      } catch (error: any) {
        this.handleHttpError(error, 'search');
      }
    }
  • Instantiation and registration of the ScienceDirectSearcher instance in the global searchers object, using the ELSEVIER_API_KEY environment variable.
    const scienceDirectSearcher = new ScienceDirectSearcher(process.env.ELSEVIER_API_KEY);
    const springerSearcher = new SpringerSearcher(
      process.env.SPRINGER_API_KEY,
      process.env.SPRINGER_OPENACCESS_API_KEY
    );
    const wileySearcher = new WileySearcher(process.env.WILEY_TDM_TOKEN);
    const scopusSearcher = new ScopusSearcher(process.env.ELSEVIER_API_KEY);
    const crossrefSearcher = new CrossrefSearcher(process.env.CROSSREF_MAILTO);
    
    searchers = {
      arxiv: arxivSearcher,
      webofscience: wosSearcher,
      pubmed: pubmedSearcher,
      wos: wosSearcher,
      biorxiv: biorxivSearcher,
      medrxiv: medrxivSearcher,
      semantic: semanticSearcher,
      iacr: iacrSearcher,
      googlescholar: googleScholarSearcher,
      scholar: googleScholarSearcher,
      scihub: sciHubSearcher,
      sciencedirect: scienceDirectSearcher,
      springer: springerSearcher,
      wiley: wileySearcher,
      scopus: scopusSearcher,
      crossref: crossrefSearcher
    };
    
    logDebug('Searchers initialized successfully');
    return searchers;
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It only mentions the API key requirement, but doesn't describe what the search returns (e.g., metadata, abstracts, full text availability), pagination behavior, rate limits, authentication scope, or error conditions. This leaves significant gaps for a search tool with 6 parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that communicates the core purpose and key requirement. It's appropriately sized and front-loaded with the main functionality, though it could potentially be more structured with separate usage notes.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a search tool with 6 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what kind of results are returned, how they're formatted, whether there's pagination, or any limitations. The API key mention is helpful but insufficient for full contextual understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 6 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema, maintaining the baseline score of 3 for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches academic papers from the Elsevier ScienceDirect database, which is a specific verb (search) and resource (academic papers from ScienceDirect). It distinguishes from siblings like search_arxiv or search_pubmed by specifying the database source, though it doesn't explicitly contrast with all similar search tools in the list.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions 'requires API key' which provides some context about prerequisites, but it doesn't offer guidance on when to use this tool versus alternatives like search_scopus or search_semantic_scholar. No explicit when/when-not instructions or comparison to sibling tools are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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