agentleFS
fmschulzfmschulz/omics-skills/skills/public-db-lookup/SKILL.md

public-db-lookup

Skill9 starsChanged 4 months agoMITView on GitHub

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.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read the card for that service in references/services.md for the path, parameters, and the right --record-path.

    line 13
  2. Very specific:

    Run the wrapper, scripts/lookup in this skill's directory (installed at ~/.agents/skills/public-db-lookup/scripts/lookup).

    line 14
  3. Very specific:

    Keep --max-items small (default 5).

    line 15
  4. Very specific:

    When the full payload matters, add --save-raw PATH and work from the file.

    line 16
  5. Very specific:

    When the payload is large, use --save-raw and report the path instead of pasting the content.

    line 25
  6. Very specific:

    Solution: Ask the user to export NCBI_EMAIL and NCBI_TOOL.

    line 81
  7. Distinctive:

    No POST requests, ID-mapping jobs, or other asynchronous job APIs

    line 85
  8. Distinctive:

    No bulk downloads of sequence or structure files

    line 86
  9. Very specific:

    No literature search; use /polars-dovmed

    line 87
  10. Distinctive:

    No JGI-internal data access (GOLD, IMG, JAMO).

    line 88

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Pick the service that owns the record: uniprot, ncbi-entrez, ncbi-datasets, mgnify, interpro, alphafold, string, or ena.
  2. Read the card for that service in references/services.md for the path, parameters, and the right --record-path.
  3. Run the wrapper, scripts/lookup in this skill's directory (installed at ~/.agents/skills/public-db-lookup/scripts/lookup).
  4. Keep --max-items small (default 5). Raise it only when the user needs more rows.
  5. When the full payload matters, add --save-raw PATH and work from the file; the envelope still carries the compacted view.
  6. For the two NCBI services, the script reads NCBI_API_KEY, NCBI_EMAIL and NCBI_TOOL from the environment, adds them as request parameters, and redacts the key from its output. Use only values the user exported; never set NCBI_EMAIL to an address from the conversation or system context.
  7. 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 --path or --param: the script refuses it, because it would be echoed back in the emitted URL and land in shell history.
  8. 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-raw and 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

FlagMeaning
--service NAMEOne of the eight services (required)
--path PATHEndpoint path relative to the service base URL, or a full URL under that base (required)
--param KEY=VALUEQuery parameter; repeat as needed
--record-path a.b.cDotted path to the record list; inferred from common keys when omitted
--max-items NRecords, list items, and dict keys kept per level (default 5)
--max-depth NNesting depth kept before containers collapse (default 3)
--format auto|json|textParse as JSON, or keep the first 800 characters of text (default auto)
--save-raw PATHWrite the full response body to PATH
--timeout SECRequest timeout (default 30)

Input Requirements

  • uv and 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 --param each
  • Optional NCBI_API_KEY, NCBI_EMAIL, NCBI_TOOL in 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, and error with code (invalid_input, network_error, http_error, invalid_response) and message
  • Exit code 0 on success, 2 for invalid_input, 1 for the other errors
  • Compaction: strings cut at 240 characters, lists at --max-items with a trailing count marker, dicts at --max-items keys with a _truncated_keys count, deeper containers replaced by an ellipsis

Quality Gates

  • --max-items is the smallest count that answers the question
  • --record-path matches 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
  • warnings and truncated from 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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.