Skip to main content
Glama
ncukondo

PubMed MCP Server

by ncukondo

PubMed Article Summary

fetch_summary

Retrieve detailed article information from PubMed by providing PMIDs to access scientific research data.

Instructions

Fetch detailed article information from PubMed using PMIDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pmidsYesArray of PubMed IDs (PMIDs) to fetch

Implementation Reference

  • Core handler factory for fetch_summary tool. Creates an object with fetchSummary method that retrieves article summaries from PubMed API.
    export function createFetchSummaryHandler(pubmedOptions: PubMedOptions) {
      const pubmedApi = createPubMedAPI(pubmedOptions);
    
      return {
        async fetchSummary(pmids: string[]): Promise<Article[]> {
          return await pubmedApi.fetchArticles(pmids);
        }
      };
    }
  • Input schema for the fetch_summary tool defining pmids as array of strings.
    inputSchema: {
      pmids: z.array(z.string()).describe('Array of PubMed IDs (PMIDs) to fetch')
    }
  • src/index.ts:177-208 (registration)
    Registers the 'fetch_summary' MCP tool with title, description, input schema, and execution handler that delegates to fetchSummaryHandler and formats the JSON response.
    server.registerTool(
      'fetch_summary',
      {
        title: 'PubMed Article Summary',
        description: 'Fetch detailed article information from PubMed using PMIDs.',
        inputSchema: {
          pmids: z.array(z.string()).describe('Array of PubMed IDs (PMIDs) to fetch')
        }
      },
      async ({ pmids }) => {
        try {
          const results = await fetchSummaryHandler.fetchSummary(pmids);
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(results, null, 2),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: 'text',
                text: `Error fetching article summaries: ${error instanceof Error ? error.message : 'Unknown error'}`,
              },
            ],
          };
        }
      }
    );
  • Instantiates the fetchSummaryHandler using PubMed options for use in tool registration and resource handler.
    const fetchSummaryHandler = createFetchSummaryHandler(pubmedOptions);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'detailed article information' but doesn't specify what that includes (e.g., title, authors, abstract), whether there are rate limits, authentication needs, or error handling. This leaves significant gaps in understanding the tool's behavior beyond basic functionality.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse. There's no wasted information, earning a high score for conciseness.

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?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'detailed article information' entails, potential limitations (e.g., batch size, availability), or error cases. For a tool with no structured behavioral data, this leaves too many unknowns for effective agent use.

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%, with the parameter 'pmids' clearly documented as an array of PubMed IDs. The description adds minimal value beyond the schema by mentioning 'using PMIDs', which reinforces but doesn't expand on the parameter's purpose. The baseline score of 3 is appropriate since the schema does the heavy lifting.

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 verb ('fetch') and resource ('detailed article information from PubMed'), making the purpose understandable. It specifies the mechanism ('using PMIDs'), which helps distinguish it from general search operations. However, it doesn't explicitly differentiate from sibling tools like 'get_fulltext' or 'search_pubmed' beyond the 'detailed article information' phrasing.

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. It doesn't mention sibling tools like 'get_fulltext' or 'search_pubmed' or explain scenarios where this tool is preferred (e.g., for known PMIDs vs. keyword searches). The usage context is implied but not explicitly stated.

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/ncukondo/pubmed-mcp'

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