Skill v1.0.1
currentAutomated scan100/100+5 new
version: "1.0.1" name: public-db-lookup description: Fetch compact JSON records from UniProt, NCBI, MGnify, InterPro, AlphaFold DB, STRING, or ENA. Use when looking up an accession, taxon, entry, or structure in a public database.
Public Database Lookup
One bounded GET against a public life-science REST API. The bundled script picks the base URL, adds a User-Agent, retries on 429 and 5xx, and prints a compact JSON envelope instead of the full payload.
Instructions
- Pick the service that owns the record:
uniprot,ncbi-entrez,ncbi-datasets,mgnify,interpro,alphafold,string, orena. - Read the card for that service in references/services.md for the path, parameters, and the right
--record-path. - Run the wrapper,
scripts/lookupin this skill's directory (installed at~/.agents/skills/public-db-lookup/scripts/lookup). - Keep
--max-itemssmall (default 5). Raise it only when the user needs more rows. - When the full payload matters, add
--save-raw PATHand work from the file; the envelope still carries the compacted view. - For the two NCBI services, the script reads
NCBI_API_KEY,NCBI_EMAILandNCBI_TOOLfrom the environment, adds them as request parameters, and redacts the key from its output. Use only values the user exported; never setNCBI_EMAILto an address from the conversation or system context. - Requests are paced across invocations, so calling the CLI in a loop stays inside each service's documented rate. The timestamps live under
$XDG_STATE_HOME/omics-skills/public-db-lookup; override with--state-dir. Never pass a credential in--pathor--param: the script refuses it, because it would be echoed back in the emitted URL and land in shell history. - Route PubMed and PMC literature searches to
/polars-dovmed; this skill does not cover them.
Execution behavior
- Summarize the JSON envelope in Markdown by default.
- Return raw JSON only when the user asks for machine-readable output.
- When the payload is large, use
--save-rawand report the path instead of pasting the content. - Re-run the lookup rather than trust tool output from earlier in a long conversation.
Quick Reference
| Flag | Meaning | |||
|---|---|---|---|---|
--service NAME | One of the eight services (required) | |||
--path PATH | Endpoint path relative to the service base URL, or a full URL under that base (required) | |||
--param KEY=VALUE | Query parameter; repeat as needed | |||
--record-path a.b.c | Dotted path to the record list; inferred from common keys when omitted | |||
--max-items N | Records, list items, and dict keys kept per level (default 5) | |||
--max-depth N | Nesting depth kept before containers collapse (default 3) | |||
| `--format auto\ | json\ | text` | Parse as JSON, or keep the first 800 characters of text (default auto) | |
--save-raw PATH | Write the full response body to PATH | |||
--timeout SEC | Request timeout (default 30) |
Input Requirements
uvand network access; the PEP 723 script installs its pinned HTTP dependency- A service name and an endpoint path from the service card
- Optional query parameters, one
--parameach - Optional
NCBI_API_KEY,NCBI_EMAIL,NCBI_TOOLin the environment for NCBI services
Output
One JSON object on stdout.
- Success:
ok,source,url(api_key value removed),status_code,warnings,raw_output_path(the path given to--save-raw, else null), plus one of: - list results:
record_path,record_count_returned,record_count_available,truncated,records - other JSON:
summary,top_keys - text:
text_head,text_head_truncated - Failure:
ok: false,source, anderrorwithcode(invalid_input,network_error,http_error,invalid_response) andmessage - Exit code 0 on success, 2 for
invalid_input, 1 for the other errors - Compaction: strings cut at 240 characters, lists at
--max-itemswith a trailing count marker, dicts at--max-itemskeys with a_truncated_keyscount, deeper containers replaced by an ellipsis
Quality Gates
- [ ]
--max-itemsis the smallest count that answers the question - [ ]
--record-pathmatches the service card, or the inferred path in the envelope is the intended list - [ ] NCBI credentials come from the environment, never from the command line
- [ ]
warningsandtruncatedfrom the envelope reach the user - [ ] Every accession or identifier in the reply came from the response, not from memory
Troubleshooting
Issue: http_error with HTTP 429 after retries.
Solution: The service is rate limiting you. Wait, lower the request rate, and for NCBI set NCBI_API_KEY to raise the allowed rate.
Issue: records is empty or the envelope falls back to summary with a warning.
Solution: The record list is not under an inferred key. Read top_keys and pass the right --record-path from the service card.
Issue: NCBI rejects or throttles requests that carry no contact details.
Solution: Ask the user to export NCBI_EMAIL and NCBI_TOOL; NCBI asks for both on every E-utilities request.
Non-Goals
- No POST requests, ID-mapping jobs, or other asynchronous job APIs
- No bulk downloads of sequence or structure files
- No literature search; use
/polars-dovmed - No JGI-internal data access (GOLD, IMG, JAMO); this skill covers public endpoints only