Skip to main content
Glama

PubMed MCP Server

fetch_pubmed_content

Retrieve detailed PubMed content by PMIDs, queryKey/webEnv, or pagination. Supports abstract_plus, full_xml, medline_text, or citation_data detail levels. Returns JSON or raw text for analysis or citation purposes.

Instructions

Fetches detailed information from PubMed using NCBI EFetch. Can be used with a direct list of PMIDs or with queryKey/webEnv from an ESearch history entry. Supports pagination (retstart, retmax) when using history. Available 'detailLevel' options: 'abstract_plus' (parsed title, abstract, authors, journal, keywords, DOI, optional MeSH/grant info), 'full_xml' (JSON representation of the PubMedArticle XML structure), 'medline_text' (MEDLINE format), or 'citation_data' (minimal data for citations). Returns a JSON object containing results, any PMIDs not found (if applicable), and EFetch details.

Input Schema

NameRequiredDescriptionDefault
detailLevelNoSpecifies the level of detail for the fetched content. Options: 'abstract_plus' (parsed details including abstract, authors, journal, DOI, etc.), 'full_xml' (raw PubMedArticle XML), 'medline_text' (MEDLINE format), 'citation_data' (minimal parsed data for citations). Defaults to 'abstract_plus'.abstract_plus
includeGrantInfoNoApplies to 'abstract_plus' if parsed from XML.
includeMeshTermsNoApplies to 'abstract_plus' and 'citation_data' if parsed from XML.
outputFormatNoSpecifies the final output format of the tool. - 'json' (default): Wraps the data in a standard JSON object. - 'raw_text': Returns raw text for 'medline_text' or 'full_xml' detailLevels. For other detailLevels, 'outputFormat' defaults to 'json'.json
pmidsNoAn array of PubMed Unique Identifiers (PMIDs) for which to fetch content. Use this OR queryKey/webEnv.
queryKeyNoQuery key from ESearch history server. If used, webEnv must also be provided. Use this OR pmids.
retmaxNoMaximum number of records to retrieve. Used with queryKey/webEnv.
retstartNoSequential index of the first record to retrieve (0-based). Used with queryKey/webEnv.
webEnvNoWeb environment from ESearch history server. If used, queryKey must also be provided. Use this OR pmids.

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "detailLevel": { "default": "abstract_plus", "description": "Specifies the level of detail for the fetched content. Options: 'abstract_plus' (parsed details including abstract, authors, journal, DOI, etc.), 'full_xml' (raw PubMedArticle XML), 'medline_text' (MEDLINE format), 'citation_data' (minimal parsed data for citations). Defaults to 'abstract_plus'.", "enum": [ "abstract_plus", "full_xml", "medline_text", "citation_data" ], "type": "string" }, "includeGrantInfo": { "default": false, "description": "Applies to 'abstract_plus' if parsed from XML.", "type": "boolean" }, "includeMeshTerms": { "default": true, "description": "Applies to 'abstract_plus' and 'citation_data' if parsed from XML.", "type": "boolean" }, "outputFormat": { "default": "json", "description": "Specifies the final output format of the tool. \n- 'json' (default): Wraps the data in a standard JSON object. \n- 'raw_text': Returns raw text for 'medline_text' or 'full_xml' detailLevels. For other detailLevels, 'outputFormat' defaults to 'json'.", "enum": [ "json", "raw_text" ], "type": "string" }, "pmids": { "description": "An array of PubMed Unique Identifiers (PMIDs) for which to fetch content. Use this OR queryKey/webEnv.", "items": { "pattern": "^\\d+$", "type": "string" }, "maxItems": 200, "type": "array" }, "queryKey": { "description": "Query key from ESearch history server. If used, webEnv must also be provided. Use this OR pmids.", "type": "string" }, "retmax": { "description": "Maximum number of records to retrieve. Used with queryKey/webEnv.", "minimum": 1, "type": "integer" }, "retstart": { "description": "Sequential index of the first record to retrieve (0-based). Used with queryKey/webEnv.", "minimum": 0, "type": "integer" }, "webEnv": { "description": "Web environment from ESearch history server. If used, queryKey must also be provided. Use this OR pmids.", "type": "string" } }, "type": "object" }

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

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