К основному содержанию
скилл CX Codex

pubmed-database — скилл для Claude Code: поиск статей в PubMed

Скилл даёт агенту доступ к PubMed и PubMed Central: искать статьи, вытаскивать абстракты и полный текст, связывать публикации с биологическими базами.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add google-deepmind/science-skills --skill pubmed-database -a claude-code
npx skills add google-deepmind/science-skills --skill pubmed_database -a claude-code
Открыть на GitHub

Что делает pubmed-database

Скилл оборачивает NCBI E-utilities и PMC BioC API в один CLI scripts/pubmed_api.py с десятью функциями: поиск по запросу, загрузка абстрактов, полный текст из PMC, линковка на гены, белки, нуклеотиды и PubChem, проверка медицинской орфографии, сопоставление сырых цитат и кеширование наборов результатов. Агент вызывает функции через uv run, а JSON на выходе фильтруется через jq — так контекст не забивается лишними полями.

Перед первым запуском нужен uv в PATH и файл .env в домашней директории. Ключ NCBI_API_KEY необязателен, но с ним лимит поднимается с 3 до 10 запросов в секунду; без ключа скилл работает, однако при серии запросов можно поймать 429. USER_EMAIL тоже опционален и просто идентифицирует вызывающего для NCBI.

Обращаться к API напрямую через curl или свой код нельзя — обёртка сама следит за лимитами. Ещё скилл требует разово подтвердить, что вы прочитали условия PubMed и NCBI, и создаёт файл-отметку в .licenses/. Если планируете массовую выборку, читайте референсы по группам функций: аргументы и флаги описаны только там, по именам функций их не угадать.

Какие задачи решает

  • найти статьи по свободному запросу и получить список PMID
  • вытащить абстракты пачкой по списку идентификаторов
  • связать публикацию с конкретным геном или соединением
  • сопоставить сырую цитату с записью в PubMed
  • проверить написание медицинского термина перед поиском

Примеры запросов агенту

  • Найди в PubMed статьи про BRCA1, выведи 5 результатов и покажи заголовки
  • Загрузи абстракты для PMID 35113657 и оставь только title и abstract
  • Свяжи эту статью с записями в PubChem и Gene

Как установить pubmed-database

1Через Skills CLI (Vercel)

npx skills add google-deepmind/science-skills --skill pubmed-database -a claude-code
npx skills add google-deepmind/science-skills --skill pubmed_database -a claude-code

2Вручную: положить файлы

~/.claude/skills/pubmed_database/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/pubmed_database/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о pubmed-database

Как установить pubmed-database в Claude?

Выполните npx skills add google-deepmind/science-skills --skill pubmed-database -a claude-code, затем npx skills add google-deepmind/science-skills --skill pubmed_database -a claude-code. После этого файл скилла лежит в ~/.claude/skills/pubmed_database/SKILL.md.

Что делает pubmed-database?

Ищет научные статьи в PubMed, забирает абстракты и полный текст из PMC, связывает публикации с базами генов, белков, нуклеотидов и PubChem. Плюс проверяет медицинскую орфографию и сопоставляет цитаты.

Нужен ли ключ NCBI для работы скилла?

Нет, без ключа всё работает. NCBI_API_KEY поднимает лимит с 3 до 10 запросов в секунду, поэтому его стоит завести, если запросов много или вы уже видели ошибку 429.

Исходный текст

SKILL.md · Apache-2.0
---
name: pubmed-database
description: >-
  Search PubMed for scientific literature, including published clinical trials.
  Fetch abstracts and full text. Link published research to biological databases
  (gene, protein, nucleotide, PubChem) to discover associations between papers
  and specific compounds or genes. Verify medical spelling, match raw citations,
  and cache result sets for bulk processing. Interfaces NCBI E-utilities and PMC
  BioC APIs.
---

# PubMed API

## Prerequisites

1.  **`uv`**: Read the `uv` skill and follow its Setup instructions to ensure
    `uv` is installed and on PATH.
2.  **User Notification**: If .licenses/pubmed_database_LICENSE.txt does not
    already exist in the workspace root directory then (1) prominently notify
    the user to check the terms at https://pubmed.ncbi.nlm.nih.gov/disclaimer/
    and https://www.ncbi.nlm.nih.gov/home/about/policies/ and to always check
    the license of the papers retrieved by the skill for any restrictions, then
    (2) create the file recording the notification text and timestamp.
3.  **`.env` file**: Make sure the `.env` file exists in your home directory.
    Create one if it does not exist.
4.  **`NCBI_API_KEY`** (optional): Raises the NCBI E-utilities rate limit from 3
    to 10 requests/second. The skill works without it, but a key is recommended
    if the user plans many queries or encounters a 429 error. You can register
    for a key for free at https://www.ncbi.nlm.nih.gov/account/settings/. You
    **MUST** use the safe credentials protocol in the `credentials` skill to
    check for and request this key if this skill looks relevant to the user's
    request.
5.  **`USER_EMAIL`** (optional): Identifies the caller to NCBI (recommended by
    their Terms of Use). You **MUST** use the safe credentials protocol in the
    `credentials` skill to check for and request this credential if this skill
    looks relevant to the user's request.

This skill provides CLI access to the NCBI PubMed and PubMed Central APIs via
`scripts/pubmed_api.py` — a single CLI with 10 functions covering search, fetch,
linking, full text, spelling, discovery, citation matching, and caching.

## Core Rules

-   **API Use**: Always use the provided wrapper `scripts/pubmed_api.py` which
    manages rate limits automatically and prevents API abuse. Setting the
    `NCBI_API_KEY` environment variable raises the rate limit from 3 to 10
    requests/second. Querying the API any other way (e.g. via curl, wget, or
    hand-written code) is strictly forbidden.
-   **JSON Processing**: Use `jq` to filter and transform JSON output (or python
    equivalents if `jq` is not available) to prevent hallucinations and context
    overflow.
-   **Temporary Files**: To avoid polluting the working directory with JSON
    files, use a temporary directory inside the current directory. When running
    multiple agents or tasks in parallel, ensure each uses a unique subdirectory
    name (e.g., `tmp_$TASK_ID/`) to avoid file collisions.
-   **Notification**: If this skill is used, ensure this is mentioned in the
    output AND list the URLs of all papers that were used in producing the
    output.

## Structure of the skill folder

-   `SKILL.md` - This file
-   `scripts/pubmed_api.py` - The skill CLI
-   `references/` - Directory with detailed function specifications
    -   `advanced-linking.md`
    -   `advanced-search.md`
    -   `bulk-workflows.md`
    -   `citation-matching.md`
    -   `cross-database-linking.md`
    -   `fetch-and-resolve.md`
    -   `search-and-discovery.md`
    -   `utilities.md`

## CLI Usage

```bash
uv run scripts/pubmed_api.py <output_file> <function_name> <required_args> [--flag value ...]
```

-   **Positional Arguments**: Arguments are positional; list arguments are
    passed as comma-separated strings without spaces (e.g.
    `"35113657,31234568"`).
-   **Flag Options**: Optional arguments can be passed as `--flag value` instead
    of positional args.
-   **Output Handling**: On success, JSON is written to `output_file`. On error,
    the process exits with a non-zero code and no output file is written.

### Example Usage

```bash
uv run scripts/pubmed_api.py ./search_results.json search_pubmed "BRCA1" --max_results 5
cat ./search_results.json | jq '.[]' -r
uv run scripts/pubmed_api.py ./abstracts.json fetch_article_abstracts "35113657"
cat ./abstracts.json | jq '.[0].title' -r
```

## Essential Recipes

**Join PMIDs for the next call (most common chaining pattern):**

```bash
cat ./search_results.json | jq -r 'join(",")'
```

**Slim abstracts to essential fields and truncate long abstracts:**

```bash
cat ./abstracts.json | jq '[.[] | {pmid, title, snippet: (.abstract // "")[:500]}]'
```

**Filter by keyword (null-safe):**

```bash
cat ./abstracts.json | jq '[.[] | select((.title // "") | contains("Review"))]'
```

### Context Management & Accuracy

When processing larger result sets (>10 abstracts):

1.  **Filter Early**: Use `jq` to verify keywords in abstracts *before* reading
    the full JSON into context.
2.  **Slimming**: Extract only `title` and `abstract` fields unless explicitly
    instructed otherwise. Author lists and metadata contribute to noise.
3.  **Bulk Operations (N > 10)**: Avoid fetching or processing IDs one-by-one.
    The API and History Server are designed for bulk retrieval. Fetch all data
    in a **single turn** and use shell pipelines to slim the results before
    reading into context. This prevents turn exhaustion and context overflow.
4.  **Grounding**: Never use internal knowledge to provide specific identifiers
    (PMIDs, CIDs, Gene IDs) if no results are found. Report the tool's output
    accurately to ensure results are grounded in the current database state.
5.  **Search Termination**: When asked to find papers that may not exist, limit
    exploration to 3–5 high-quality, varied search queries. If no results match
    after these attempts, conclude that no papers meet the criteria rather than
    continuing to iterate — unless explicitly instructed to be thorough.

## Functions

> **⚠️ MANDATORY**: You **MUST** read the linked reference file for a function
> group **before calling any function** in that group. The tables below only
> describe *what* each function does — not *how* to call it. Argument names,
> argument order, flags, and output schemas are **only** documented in the
> reference files. **Do NOT guess or infer arguments from function names.** If
> you call a function without first reading its reference, you **will** produce
> incorrect invocations.

### [Search](references/search-and-discovery.md)

-   `search_pubmed`: Find PMIDs matching a free-text or structured NCBI query.
-   `global_database_discovery`: Count how many records match a query across
    every NCBI database.

### [Fetch & Resolve](references/fetch-and-resolve.md)

-   `fetch_article_abstracts`: Retrieve metadata and abstracts for a batch of
    PMIDs.
-   `get_full_text_pmc`: Retrieve open-access full text from PMC.
-   `fetch_database_summary`: Resolve opaque UIDs from any NCBI database into
    human-readable metadata.

### [Cross-Database Linking](references/cross-database-linking.md)

-   `find_linked_biological_data`: Find records in other NCBI databases linked
    to a source record.
-   `discover_available_links`: List all available ELink linknames for a given
    record.

### [Bulk Workflows](references/bulk-workflows.md)

When working with **more than ~10 PMIDs**, avoid processing IDs one-by-one.
Upload them to the NCBI History Server via `cache_results_history` to get a
session handle (`webenv` + `query_key`), then pass that handle to
`fetch_article_abstracts` or `find_linked_biological_data` for a single bulk
call. Chain with `jq` shell pipelines to slim results before reading into
context. This prevents turn exhaustion and context overflow. See the reference
for complete workflow recipes (search→fetch, cross-db exploration, citation
resolution, and bulk retrieval with data slimming).

-   `cache_results_history`: Upload PMIDs to the NCBI History Server for bulk
    retrieval.

### [Utilities](references/utilities.md)

-   `verify_medical_spelling`: Spell-check biomedical terms before searching.
-   `match_raw_citations`: Resolve incomplete bibliographic citations to PMIDs.

© google-deepmind · Apache-2.0 · google-deepmind/science-skills

Похожие скиллы

Всё по теме «Наука и исследования» →
biopython K-Dense-AI Скилл помогает автоматизировать задачи биоинформатики: разбирать файлы FASTA и PDB, выравнивать последовательности и запрашивать данные через NCBI Entrez. CX Codex +1 2 000установок firecrawl-research-papers firecrawl Скилл для поиска и анализа научных публикаций через Firecrawl Research. Помогает собирать обзоры литературы по базам PubMed, bioRxiv, medRxiv и arXiv. CX Codex +1 33 800установок firecrawl-research-index firecrawl Скилл ищет статьи по исследовательскому запросу в индексе Firecrawl: семантический поиск по абстрактам, расширение по цитатам и проверка по полному тексту. CX Codex +1 24 400установок novelty-assessment lingzhi227 Прогоняет исследовательскую идею через поиск по научным статьям и выносит вердикт: новая или нет. Пригодится до того, как вы вложитесь в направление. CX Codex +1 1 800установок tooluniverse-literature-deep-research mims-harvard Скилл для глубокого поиска по научной литературе: PubMed, EuropePMC, bioRxiv, сети цитирований. Пригодится, когда нужен обзор с оценкой доказательств и ссылками. CX Codex +1 664установок gemini-search wanshuiyin Скилл ищет научные статьи через Gemini, разбивая тему на подзадачи и смежные термины. Пригодится для глубокого обзора литературы за пределами точных ключевых слов. CX Codex +1 407установок

Из того же набора39

literature-search-arxiv Ищет статьи и препринты на arXiv, вытаскивает метаданные и абстракты, скачивает PDF, HTML или LaTeX-исходники в рабочую папку. CX Codex +1 3 400установок literature-search-openalex Скилл подключает базу OpenAlex для поиска научных публикаций, выгрузки PDF и сбора библиометрии через CLI. Пригодится при проверке DOI и анализе цитирований авторов. CX Codex +1 3 100установок literature-search-europepmc Ищет научные статьи в Europe PMC, скачивает открытые полные тексты и PDF, собирает цитаты и списки литературы. CX Codex +1 2 600установок literature-search-biorxiv Ищет препринты в bioRxiv и medRxiv по DOI или датам. Нужен для отбора публикаций по категории, автору и ключевым словам. CX Codex +1 2 500установок workflow-skill-creator Превращает уже завершённый процесс работы с агентом в переиспользуемый скилл. Нужен, когда вы хотите упаковать удачную последовательность действий. CX Codex +1 2 400установок clinical-trials-database Ищет клинические исследования в базе ClinicalTrials.gov через REST API v2. Помогает подбирать исследования по диагнозу, препарату, фазе и статусу набора пациентов. CX Codex +1 2 400установок human-protein-atlas-database Извлекает данные об экспрессии белков и их субклеточной локализации из Human Protein Atlas. Помогает проверить наличие белка в тканях человека и опухолях. CX Codex +1 2 200установок opentargets-database Скилл даёт агенту доступ к Open Targets Platform через GraphQL: связи ген-болезнь, данные о лекарствах и оценка перспективности мишени. CX Codex +1 2 200установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой