pubmed-database
google-deepmind/science-skills
Search PubMed, fetch abstracts and full text, link to biological databases (genes, proteins, compounds).
What is pubmed-database?
Access NCBI PubMed and PubMed Central APIs to search scientific literature, retrieve article metadata and full text, and discover associations between papers and biological entities. Use this when you need to find published research, verify medical terminology, match citations, or explore connections between genes, proteins, and compounds across the literature.
- Search PubMed with free-text or structured NCBI queries to find relevant PMIDs
- Fetch article abstracts, titles, and metadata in bulk
- Retrieve open-access full text from PubMed Central (PMC)
- Link published research to biological databases (genes, proteins, nucleotides, PubChem compounds)
- Verify medical spelling and match raw citations against the database
- Cache large result sets on the NCBI History Server for efficient bulk processing
How to install pubmed-database
npx skills add https://github.com/google-deepmind/science-skills --skill pubmed-database- Install and configure `uv` (Python package manager)
- Create or update `.env` file in home directory
- (Optional but recommended) Register for free NCBI API key at https://www.ncbi.nlm.nih.gov/account/settings/ to raise rate limits from 3 to 10 requests/second
- (Optional but recommended) Provide USER_EMAIL in credentials for NCBI identification
- Review NCBI terms of use at https://pubmed.ncbi.nlm.nih.gov/disclaimer/ and https://www.ncbi.nlm.nih.gov/home/about/policies/
How to use pubmed-database
- 1.Run searches using `uv run scripts/pubmed_api.py <output_file> search_pubmed <query>` to find PMIDs matching your research question
- 2.Use `jq` to extract and filter results (e.g., `cat results.json | jq -r 'join(",")'` to chain PMIDs to the next call)
- 3.Fetch abstracts for relevant papers with `fetch_article_abstracts` using the PMIDs from step 1
- 4.For large batches (>10 PMIDs), cache results on the NCBI History Server using `cache_results_history` to avoid rate limits and context overflow
- 5.Link papers to biological databases using `find_linked_biological_data` to discover gene-to-paper or compound-to-paper associations
- 6.Retrieve full text from open-access articles using `get_full_text_pmc` when abstracts are insufficient
Use cases
- Literature review: search for papers on a topic and retrieve abstracts to identify relevant studies
- Gene discovery: find all papers linked to a specific gene and explore associated proteins or compounds
- Clinical trial research: search for published clinical trials and fetch their full text protocols
- Citation verification: match incomplete or misspelled citations to correct PubMed records
- Bulk data extraction: process hundreds of PMIDs efficiently by caching on the History Server and fetching in a single operation
- Biomedical researchers and literature reviewers
- Bioinformaticians exploring gene-to-paper associations
- Clinical researchers verifying trial data
- Students and academics conducting systematic reviews
- Data scientists building datasets from published literature
pubmed-database FAQ
No, the skill works without one, but an API key is strongly recommended. It raises the rate limit from 3 to 10 requests/second and is free to register at https://www.ncbi.nlm.nih.gov/account/settings/.
For more than ~10 PMIDs, use `cache_results_history` to upload IDs to the NCBI History Server, then pass the session handle to `fetch_article_abstracts` or `find_linked_biological_data` for bulk retrieval in a single call. This prevents turn exhaustion and context overflow.
Only open-access articles from PubMed Central (PMC) are available via `get_full_text_pmc`. Paywalled articles require institutional access or purchase.
Set the `NCBI_API_KEY` environment variable using the credentials skill. Without a key, the limit is 3 requests/second; with a key, it's 10 requests/second.
Always use the tool's actual output. Never invent identifiers from internal knowledge. If a search returns no results after 3–5 varied queries, report that no papers match the criteria rather than guessing.
Full instructions (SKILL.md)
Source of truth, from google-deepmind/science-skills.
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
uv: Read theuvskill and follow its Setup instructions to ensureuvis installed and on PATH.- 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.
.envfile: Make sure the.envfile exists in your home directory. Create one if it does not exist.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 thecredentialsskill to check for and request this key if this skill looks relevant to the user's request.USER_EMAIL(optional): Identifies the caller to NCBI (recommended by their Terms of Use). You MUST use the safe credentials protocol in thecredentialsskill 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.pywhich manages rate limits automatically and prevents API abuse. Setting theNCBI_API_KEYenvironment 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
jqto filter and transform JSON output (or python equivalents ifjqis 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 filescripts/pubmed_api.py- The skill CLIreferences/- Directory with detailed function specificationsadvanced-linking.mdadvanced-search.mdbulk-workflows.mdcitation-matching.mdcross-database-linking.mdfetch-and-resolve.mdsearch-and-discovery.mdutilities.md
CLI Usage
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 valueinstead 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
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):
cat ./search_results.json | jq -r 'join(",")'
Slim abstracts to essential fields and truncate long abstracts:
cat ./abstracts.json | jq '[.[] | {pmid, title, snippet: (.abstract // "")[:500]}]'
Filter by keyword (null-safe):
cat ./abstracts.json | jq '[.[] | select((.title // "") | contains("Review"))]'
Context Management & Accuracy
When processing larger result sets (>10 abstracts):
- Filter Early: Use
jqto verify keywords in abstracts before reading the full JSON into context. - Slimming: Extract only
titleandabstractfields unless explicitly instructed otherwise. Author lists and metadata contribute to noise. - 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.
- 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.
- 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
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
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
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
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
verify_medical_spelling: Spell-check biomedical terms before searching.match_raw_citations: Resolve incomplete bibliographic citations to PMIDs.
Related skills
More from google-deepmind/science-skills and the wider catalog.

pymol
Visualize, analyze, and render protein and molecular structures using PyMOL.

quickgo-database
Query Gene Ontology and functional annotations via QuickGO REST API to map genes to biological processes and molecular functions.

reactome-database
Query Reactome pathway database for enrichment analysis, identifier mapping, and pathway navigation.

scienceskillscommon
>-

string-database
Query protein-protein interactions, functional enrichment, and homology from the STRING database.

ucsc-conservation-and-tfbs
Fetch evolutionary conservation scores and transcription factor binding sites from UCSC Genome Browser.