Pubmed Database
Google DeepMindOfficialPublished by Google DeepMind
- Skill
- Tool integration
- Science and research
- Apache-2.0
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The pubmed-database skill provides a structured command-line interface to interact with NCBI E-utilities and PMC BioC APIs. It enables users to perform complex literature searches, retrieve abstracts and full-text articles, and discover cross-database links between research papers and biological entities such as genes, proteins, and chemical compounds. The tool includes built-in rate limiting, caching mechanisms for bulk processing, and utilities for citation matching and medical spelling verification.
What it does
- Search PubMed for scientific literature and clinical trials using advanced query syntax.
- Retrieve article abstracts and open-access full-text content from PubMed Central.
- Link research papers to biological databases including Gene, Protein, and PubChem.
- Verify medical spelling and resolve raw bibliographic citations to PMIDs.
- Manage bulk data retrieval using the NCBI History Server to optimize performance.
- Filter and transform API results using shell pipelines for efficient data processing.
When to use it
- When you need to perform systematic literature reviews or gather scientific evidence.
- When you need to map research papers to specific biological identifiers or chemical compounds.
- When you are processing large sets of PubMed IDs that require bulk retrieval.
- When you need to resolve incomplete citations or verify the spelling of biomedical terms.
Advantages
- Automated rate limit management prevents API abuse and service interruptions.
- Supports complex boolean logic and MeSH term filtering for high-precision searches.
- Enables seamless integration with shell tools like jq for data filtering and slimming.
- Provides a structured approach to cross-referencing literature with genomic and chemical data.
Usage examples
- “Find the 5 most recent papers on BRCA1 and save the results to a file.”
- The agent executes a search query for BRCA1, limits the results to 5, and writes the metadata to a local JSON file.
- “Get the abstracts for the following PMIDs: 35113657, 31234568.”
- The agent uses the fetch_article_abstracts function to retrieve and display the requested abstracts.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/google-deepmind/pubmed-database/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip pubmed-database.zip -d .agents/skills
Documentation by Google DeepMind
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' -rEssential 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.
Files
- ATTRIBUTION.mdAdded by AutoGineer912 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md8.1 KiB
- references/advanced-linking.md5.4 KiB
- references/advanced-search.md3.6 KiB
- references/bulk-workflows.md3.5 KiB
- references/citation-matching.md5.2 KiB
- references/citation.bib1.8 KiB
- references/cross-database-linking.md3.9 KiB
- references/fetch-and-resolve.md5.5 KiB
- references/search-and-discovery.md4.8 KiB
- references/utilities.md1.3 KiB
- scripts/pubmed_api.pyScript20.9 KiB
references/search-and-discovery.md
Search Functions
Detailed argument specifications, output schemas, search strategies, and
troubleshooting for search_pubmed and global_database_discovery.
1. search_pubmed — Find PMIDs by query
Returns a list of PubMed IDs matching a free-text query. Supports full NCBI
query syntax: Boolean operators (AND, OR, NOT), MeSH terms and tags.
Syntax: Use term[tag](e.g., Parkinson[ti]). Tags are NOT case-sensitive.
Most common tags:
[tiab]: Title & Abstract (Best for keyword precision).
[mesh]: Medical Subject Headings (Best for conceptual accuracy).
[pt]: Publication Type (Filter by Review, Clinical Trial, Case Reports).
[dp]: Publication Date (Interchangeable with [pdat]).
Modern Power Moves:
Relative Dates: Use
"last X months"[dp]or"last X years"[dp](e.g.,"last 1 months"[dp]).Proximity Search:
"word1 word2"[tiab:~N]finds words within N tokens. Use this instead of AND for multi-word concepts (e.g.,"gut microbiome"[tiab:~2]).
Reliability: Use YYYY/MM/DD:YYYY/MM/DD[dp] for custom ranges. Avoid dptr.
Search Strategies & Troubleshooting
If searching returns few or no results, try at most 3 queries before changing strategy. After 3 failed searches, the query is flawed. Broaden to core entities (gene + disease), fetch 5 abstracts, and adopt the authors' vocabulary. Relaxation order:
Drop Field Restrictors: If you used [tiab]/[ti]/[pt] in the query and got no results, remove them: key terms often appear in body text, not titles.
Too restrictive:
"CRISPR"[ti] AND "indirect cardiovascular side effects"[tiab]Better:
"CRISPR" AND "cardiovascular" AND ("side effects" OR "toxicity" OR "unintended")
Use Broad Synonyms: Group standardized synonyms with OR.
Example:
("cardiovascular" OR "cardiac" OR "heart") AND ("toxicity" OR "adverse effects" OR "side effects" OR "off-target")
Use MeSH Terms: If keywords fail, use MeSH indexed terms.
Example:
"CRISPR-Cas Systems"[mesh] AND "Cardiovascular Diseases/chemically induced"[mesh]
Remove Granular Constraints: For highly specific intersections, drop the weakest constraint first (e.g., expand date range to 2 years, or drop "liver" and filter broader results manually).
Avoid Over-Quoting: Double quotes force exact phrase matching, with quoted words contiguous in that exact order. E.g.,
"dopaminergic neurons"excludes papers with "dopaminergic projection neurons", "dopamine neurons", "DA neurons", or with "dopaminergic" and "neurons" in separate sentences. Only quote multi-word terms where word order matters (anatomical regions, compound names). Use unquoted terms or proximity search ([tiab:~N]) for conceptual matching.Finding Primary Data: If you need raw identifiers (Sequence IDs, Chemical CIDs), append data-source terms to your query, e.g.
AND (accession[tiab] OR "GenBank"[tiab] OR "supplementary"[tiab]). This filters out review articles that discuss concepts but omit the raw data.
For advanced search tags and strategies refer to
uv run scripts/pubmed_api.py ./search_results.json search_pubmed "BRCA1 cancer" --max_results 5 --sort_by relevanceArguments:
query(str, required) – free-text or structured NCBI querymax_results(int, default 10) – maximum PMIDs to returnsort_by(str, default "relevance") –relevance,pub_date,Author,JournalName, orTitle
Output: ["35113657", "31234568"]
Filtering tips:
Prefer restrictors in initial queries to reduce noise. If a restricted query returns 0 results, see Troubleshooting above.
Publication type: append
AND "systematic review"[pt]orAND "meta-analysis"[pt]orAND "clinical trial"[pt]Date range: append
AND 2023/01:2023/12[dp]Title/abstract only: use
[tiab]tag, e.g."CRISPR off-target"[tiab]Exclude noise: append
NOT "comment"[pt] NOT "editorial"[pt]if getting too many non-original research results.
2. global_database_discovery — Count hits across all NCBI databases
Reports how many records match a query across every NCBI database at once. Useful for deciding which databases are worth querying for a given topic.
uv run scripts/pubmed_api.py ./crispr_counts.json global_database_discovery "CRISPR"Arguments:
query(str, required) – free-text query
Output: dict[str, int] — keys are NCBI database names (e.g. pubmed,
pmc, gene), values are hit counts. Only databases with ≥1 hit are included.
Example: json {"pubmed": 14500, "pmc": 4200, "gene": 12, "protein": 105}
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an API key, Needs Python
Security
What our scanner noticed· Low risk
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Google DeepMind
- Publisher
- Google DeepMind (Official)
- Source
- google-deepmind/science-skills · skills/pubmed_database · commit 4de6786
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Google DeepMind.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download pubmed-database.zip