pubmed-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| NCBI_EMAIL | No | Optional contact email; when set, it is sent with each NCBI request. | |
| NCBI_API_KEY | No | Optional NCBI API key. Read from the NCBI_API_KEY environment variable first, then from the file ~/.ncbi_api_key; if neither is available, the server uses anonymous rate limits. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| searchA | 检索 PubMed,返回命中数及 PMID、日期、期刊、标题、作者、DOI、PMC、文献类型。 term 使用英文 PubMed 语法:resorption[Title]、"root resorption"[tiab]、AND/OR/NOT、截词 *。 布尔算子写大写,引号只包短语,括号须配对。MeSH 请核对实际执行式:写错的带引号词会报 quotedphrasesnotfound,不带引号可能改写成别的概念;有命中不证明原短语存在。 sort: pub_date / relevance / author;不能按期刊质量排序。 field 可用 Title、Title/Abstract、Journal、Author、Affiliation、Language、Grant、PMID 等; 未支持值会报错。MeSH/文献类型请写进 term 的 [MeSH Terms]/[Publication Type] 标签。 日期按发表日期;mindate/maxdate 接受 YYYY、YYYY-MM、YYYY-MM-DD 或斜杠写法。 单端日期自动补另一端并提示。reldate=0 不限,正数为最近天数;和显式日期同时给时做 AND。 retmax 默认 20,上限 1000;retstart 为零起始偏移,上限 9998,最多可翻前 9999 条。 只要计数用 count;需要题录直接 search,无需先 count。as_json=True 返回完整解析和结构化记录。 detail: full 默认完整题录;brief 仅 PMID/日期/标题/全部文献类型;ids 仅 PMID,不取元数据或检查撤稿类型。 各档保留查询警告;brief 省略字段不表示缺失,ids 的 returned 计 PMID 数、esummary_missing 为 null。 先读 ⚠️:改写后的命中数不等于原查询命中数;0 条不证明主题无文献。PMC 号不保证立即可下载。 |
| countA | 只取 PubMed 命中数,不取题录;需要题录直接用 search,避免重复检索。 term、field、日期参数规则同 search:英文词,大写 AND/OR/NOT,日期按发表日期。 返回实际执行式及 ⚠️;丢词/短语改写后的计数不能当原查询计数。0 条不证明主题无文献, 有命中也不证明原短语存在;确认短语须读取题录或摘要。完整解析可用 search(retmax=0, as_json=True)。 |
| fetch_abstractsA | 按逗号/空格分隔的 PMID 取 NCBI 原排版摘要;保留结构化段落、作者信息和声明。 自动去重、归一补零号、分批。建议先筛选题录,再只取需要的摘要以节省输出。 返回请求数、实际记录数和缺失号;有记录不等于有摘要,社论可能只有引文。 网络失败报错,不冒充无记录。文献数值引用仍须核对原文位置。 |
| linksA | 查 PMID 的数据库关联或引文追踪。pmids 用逗号/空格分隔,去重后最多 50 个。 to: pmc(默认)/ gene / nucleotide / pubmed / citedin(施引)/ refs(参考文献),大小写不敏感。 每行列直接关联号;方括号是其它关联计数。citedin/refs 供滚雪球追踪(0 条仅限 PubMed 已录入关系,不等于无引文)。 to=pubmed 是相关文献,含自身;to=pmc 是 PMC 关联,不保证开放许可或此刻可下载。 无关联、元数据不可用与存在性未知分开报告;esummary 缺失不证明 PMID 不存在。 search 已给 PMC 时无需重复查询 links。内部逐 PMID 请求以保留归属,失败明确标注。 |
| check_recallA | 已知文献找回测试:一批已知相关 PMID 里哪些被 term 检回。pmids 逗号/空格分隔,去重后最多 200 个。 分批 esearch 交集判定 found/missing(每批 50 个,避免 GET URL 超长被 NCBI 414);缺失项附标题与存在状态。 只证明这批已知集的找回,不代表整体查全率;金标准集本身可能有偏。 逐块诊断用 count("概念块 AND pmid[uid]")。查询警告原样透传;term 被忽略或部分词未生效时显著告警。 |
| meshA | 查 MeSH 主题词表:描述符、入口词(同义词)、树号、上下位词、历史前身词(previous indexing)、范围注、引入年份。 词表以查询时点 NCBI 返回为准;retmax 默认 5、上限 20(本批候选内精确匹配置顶)。 历史前身词供扩展旧标引词,不保证补齐;下位词(最多展 10 个)供决定是否展开。 无描述符命中不等于主题无文献;NCBI 报 phrasesnotfound 时告警。 |
| diffA | 对比两个 PubMed 查询的结果集:b 相对 a 新增、丢失了哪些 PMID。 检索式迭代前后核对增减;两查询都须在 9999 窗口内,超窗报错(先缩小或改用 export)。 max_show 默认 20、上限 200,文本档每侧只展示部分;as_json=True 给完整列表。 集合差只描述增减,不判断相关性;命中更多不等于更好。两次查询间数据库可能更新。 |
| exportA | 取全某查询的 PMID 并写文件;超 9999 窗口自动按发表日期二分切片。 format: pmids(纯 PMID 列表)/ csv(核心题录字段,不含摘要)/ medline(.nbib,保留来源中已有的摘要与主题词)。 只回摘要(总数/片数/去重/路径/sha256),不回记录本身。path 显式给出且不得已存在(不覆盖)。 切片计数与总数核对,不一致如实报告;检索期间数据库可能更新,结果以导出时点为准。 自订安全上限 10 万条。筛选工具导入兼容性以对方文档为准;不保证与 PubMed 网页导出逐字一致。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 8 tools
Each tool has a distinct role: record search, count-only, abstract retrieval, link/citation traversal, recall testing, MeSH lookup, query diffing, and bulk export. Overlaps such as search versus count and search versus fetch_abstracts are explicitly clarified by output scope and intended use.
Multiword names use snake_case, but the set mixes verb-first names (fetch_abstracts, check_recall), bare verbs (search, count, export), and bare nouns (links, mesh, diff). It is readable, but there is no single predictable naming convention.
Eight tools is well scoped for a PubMed research workflow and each tool supports a distinct part of literature retrieval or analysis. The count tool is somewhat redundant with search but is a reasonable lightweight convenience rather than bloat.
The surface covers search, counts, abstracts, related records/citations, MeSH vocabulary, recall checks, set comparison, and bulk export. Minor gaps remain around full-text/PMC retrieval and citation-manager export formats such as RIS or BibTeX.