Skip to main content
Glama
Dianel555

Paper Search MCP

by Dianel555

search_pubmed

Search biomedical literature from PubMed/MEDLINE database to find relevant research articles, reviews, and publications using NCBI E-utilities API.

Instructions

Search biomedical literature from PubMed/MEDLINE database using NCBI E-utilities API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query string
maxResultsNoMaximum number of results to return
yearNoPublication year filter (e.g., "2023", "2020-2023")
authorNoAuthor name filter
journalNoJournal name filter
publicationTypeNoPublication type filter (e.g., ["Journal Article", "Review"])
sortByNoSort results by relevance or date

Implementation Reference

  • Handler logic for executing the 'search_pubmed' MCP tool: destructures args, performs search via searchers.pubmed.search(), retrieves rate limit status, and returns formatted JSON response with paper details.
    case 'search_pubmed': {
      const { query, maxResults, year, author, journal, publicationType, sortBy } = args;
    
      const results = await searchers.pubmed.search(query, {
        maxResults,
        year,
        author,
        journal,
        publicationType,
        sortBy
      });
    
      const rateStatus = searchers.pubmed.getRateLimiterStatus();
      const apiKeyStatus = searchers.pubmed.hasApiKey() ? 'configured' : 'not configured';
      const rateLimit = searchers.pubmed.hasApiKey() ? '10 requests/second' : '3 requests/second';
    
      return jsonTextResponse(
        `Found ${results.length} PubMed papers.\n\nAPI Status: ${apiKeyStatus} (${rateLimit})\nRate Limiter: ${rateStatus.availableTokens}/${rateStatus.maxTokens} tokens available\n\n${JSON.stringify(
          results.map((paper: Paper) => PaperFactory.toDict(paper)),
          null,
          2
        )}`
      );
    }
  • Zod schema definition (SearchPubMedSchema) for input validation of the 'search_pubmed' tool parameters.
    export const SearchPubMedSchema = 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(),
        publicationType: z.array(z.string()).optional(),
        sortBy: z.enum(['relevance', 'date']).optional()
      })
      .strip();
  • MCP tool registration in TOOLS array, including name, description, and JSON inputSchema matching the Zod schema.
    {
      name: 'search_pubmed',
      description: 'Search biomedical literature from PubMed/MEDLINE database using NCBI E-utilities API',
      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: 'Publication year filter (e.g., "2023", "2020-2023")' },
          author: { type: 'string', description: 'Author name filter' },
          journal: { type: 'string', description: 'Journal name filter' },
          publicationType: {
            type: 'array',
            items: { type: 'string' },
            description: 'Publication type filter (e.g., ["Journal Article", "Review"])'
          },
          sortBy: {
            type: 'string',
            enum: ['relevance', 'date'],
            description: 'Sort results by relevance or date'
          }
        },
        required: ['query']
      }
    },
  • Schema parsing logic in parseToolArgs function for 'search_pubmed' tool.
    case 'search_pubmed':
      return SearchPubMedSchema.parse(args);
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 mentions the NCBI E-utilities API but doesn't describe rate limits, authentication requirements, pagination behavior, error handling, or what the response format looks like. For a search tool with no annotation coverage, this leaves significant behavioral gaps.

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 clearly states the tool's purpose. There's no wasted language or unnecessary elaboration. However, it could be slightly improved by front-loading more context about when to use this specific PubMed search versus other search tools.

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 7 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the search returns (abstracts, citations, full metadata?), doesn't mention rate limits or API constraints, and provides no guidance on usage context. The description should do more to compensate for the lack of structured metadata.

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 7 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in description.

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 biomedical literature from PubMed/MEDLINE using NCBI E-utilities API, providing a specific verb ('Search') and resource ('biomedical literature from PubMed/MEDLINE database'). However, it doesn't explicitly differentiate from sibling tools like search_medrxiv or search_biorxiv that also search biomedical literature, missing sibling differentiation.

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 provides no guidance on when to use this tool versus alternatives. With many sibling tools available for searching different databases (e.g., search_arxiv, search_google_scholar, search_scopus), there's no indication of when PubMed-specific searching is preferred or what makes this tool distinct from general search tools like search_papers.

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