Skill 详情
pubmed-database
Useful for literature-backed biomedical data science, but not general data science.
使用前先检查
自动化审核只检查相关性,不代表安全审查或推荐。使用前请阅读来源中的说明。
SKILL.md
这段内容是审核时保存的快照。外部来源才是完整且最新的版本。
---
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.
- **Outp在 GitHub 阅读完整来源 (打开外部页面)