Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Query Open Targets Platform for target-disease associations, drug target discovery, tractability/safety data, genetics/omics evidence, known drugs, for therapeutic target identification.
.claude/skills/mkurman-opentargets-database/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-18 | ✗→✓ | ▲ Improved | 23% | 0% |
| case-20 | ✗→✓ | ▲ Improved | 124% | 0% |
| case-21 | ✗→✓ | ▲ Improved | 71% | 0% |
| case-19 | ✓→✗ | ▼ Worse | 139% | 0% |
| case-07 | ✓→✓ | = Same ✓ | 95% | 0% |
This skill provides access to the Open Targets Platform GraphQL API. It aggregates multi-modal evidence from genetics (GWAS/eQTL), pathways, animal models, and clinical trials to rank target-disease associations and identify druggable genes.
uv: Read the uv skill and follow its Setup instructions to ensureuv is installed and on PATH.
this skill directory then (1) prominently notify the user to check the terms at https://platform-docs.opentargets.org/licence, then (2) create the file recording the notification text and timestamp.
database rather than accessing the database directly. The scripts automatically enforce fair use and implement retry logic.
--output flag is always required as output can bevery large. Use jq or write your own code to process this JSON file.
output.
Always use the provided Python script scripts/query_opentargets.py to quickly query the database. It handles API communication, retries, formatting, and automatically truncates overly large responses. NEVER write your own curl or similar requests.
Usage:
bashuv run scripts/query_opentargets.py --output /tmp/opentargets_results.json [OPTIONS] COMMAND [ARGS]...
Common Options:
--output PATH: Required. Path to write the JSON output file.--limit N: Limit the number of items returned in arrays (default is 50).Use a smaller number like 10 when doing preliminary exploration.
--page-size N: Set the API pagination size (default is 200). Increase ifyou need more results (e.g., a study with many credible sets).
Available Commands:
get-gwas-studies `efo_id`: Fetches all GWAS studies associated witha specific disease ontology EFO ID (e.g. EFO_0000685).
get-study-credible-sets `study_id`: Fetches all credible sets for agiven study ID (e.g. FINNGEN_R12_RX_CROHN_2NDLINE). Returns confidence, finemapping method, variant, and p-value info.
get-qtl-credible-sets `variant_id`: Retrieves QTL credible sets fora specific variant ID (e.g. 19_44908822_C_T).
get-l2g `variant_id [--study-id ID]`: Returns Locus-to-Gene (L2G)predictions/scores for a locus to identify the most likely causal gene. Only variant_id is required; use --study-id to filter to a specific study. Accepts chr prefix (e.g. chr1_113834946_A_G).
get-target-druggability `ensembl_id`: Provides tractability data(small molecule, antibody, etc.) and clinical trial safety info for a gene/target.
get-associated-targets `efo_id`: Find all target genes associatedwith a specific disease EFO ID.
get-associated-diseases `ensembl_id`: Find all diseases associatedwith a specific target Ensembl ID.
search-disease `query_string`: Search for a disease by name to findits EFO ID and other metadata.
get-credible-sets-near-target `ensembl_id [--window N]`: Fetchescredible sets for a target and filters them to those within a genomic window around the target. Useful for finding variants "nearby" a gene.
custom-query `query [--variables '{}']`: Run a raw GraphQL query forany other Open Targets data.
The get-l2g command has two modes:
get-l2g <variant_id>): Returns L2G predictions fromall credible sets across all studies where that variant is the lead variant. This can return a large number of results (e.g., hundreds). Use this when the user wants a broad view of which gene is most likely causal at a locus, or when no specific study is mentioned.
get-l2g <variant_id> --study-id <study_id>): ReturnsL2G predictions only for credible sets from that specific study. Use this when the user asks about a specific GWAS study or when you need to narrow down the results.
> Incomplete results warning: The variant-only mode can return hundreds of > credible sets. The default --page-size is 200, so if the API reports a > count higher than the number of rows returned, you are seeing incomplete > results. Always compare count to the actual number of rows. If they > differ, either increase --page-size or inform the user that only a subset > was retrieved.
To find studies with variants "nearby" a gene, use get-credible-sets-near-target, which improves upon the base API by performing a flexible search based on genomic position: uv run scripts/query_opentargets.py --output /tmp/results.json get-credible-sets-near-target ENSG00000156515 --window 500000
Note that the Open Targets GraphQL schema includes a regions parameter for credibleSets, however it performs an exact match against pre-computed region strings (e.g., chr10:68769984-69903496) and there is some missing data. Use get-credible-sets-near-target as it allows a genomic range overlap search.
This fetches credible sets associated with the target and filters them in Python based on the variant's genomic position.
If you need to query endpoints or fields not exposed by the built-in subcommands, use the custom-query subcommand.
Before writing a custom query: Read the reference documentation to understand the API schema, types, and see example queries. See references/OpenTargets_GraphQL_Guide.md for full schema details, endpoints, and examples.
Example: Finding drugs for a disease
bashuv run scripts/query_opentargets.py custom-query \ query drugsForDisease($id: String!) { disease(efoId: $id) { name drugAndClinicalCandidates { count rows { maxClinicalStage drug { id name } } } } }' \ --variables '{"id": "EFO_1001006"}' --output '/tmp/opentargets_result.json'
The Open Targets Platform assigns a confidence level to each credible set based on the fine-mapping method and quality checks. These correspond to star ratings displayed in the platform UI:
| Stars | Confidence String (API value) | | -------------- | --------------------------------------------------------- | | ★★★★ (4 stars) | SuSiE fine-mapped credible set with in-sample LD | | ★★★ (3 stars) | SuSiE fine-mapped credible set with out-of-sample LD | | ★★ (2 stars) | PICS fine-mapped credible set extracted from summary | : : statistics : | ★ (1 star) | PICS fine-mapped credible set based on reported top hit | | None | Unknown confidence |
When users ask about "N-star confidence", match their request to the corresponding string in the confidence field of the API response.
EFO_0000685).ENSG00000169083), not HGNCsymbols. If you only have a gene symbol, you may need to map it first using a custom GraphQL search query.
chromosome_position_ref_alt (e.g.,1_154426264_C_T). A chr prefix (e.g. chr1_154426264_C_T) is automatically stripped by the tool.
GCST90204201) orproject-specific IDs (e.g. FINNGEN_R12_RX_CROHN_2NDLINE).
--limit to protectthe context window. If you see "_truncated", you can run the query again with a higher limit if you specifically need more data, but be cautious with large limit values. Always use the --output flag to save the result to a file and avoid terminal output truncation.
--page-size option (default:200) controls how many items are fetched from the API. Always check the count field in the response and compare it to the number of rows actually returned. If count > number of rows, you have incomplete data — either increase --page-size to fetch more, or inform the user that only a partial result set was returned. This is especially important for get-l2g without --study-id, which can return hundreds of credible sets.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 11,809 | 26,766 | +127% | 1 | 1 | 0% | 662 | 5,920 | +794% | 0 | 0 | — |
case-02 | fail→fail | 12,035 | 4,958 | -59% | 1 | 1 | 0% | 995 | 2,682 | +170% | 0 | 0 | — |
case-03 | fail→fail | 11,159 | 6,380 | -43% | 1 | 1 | 0% | 839 | 2,766 | +230% | 0 | 0 | — |
case-04 | fail→fail | 10,847 | 4,438 | -59% | 1 | 1 | 0% | 2,012 | 2,987 | +48% | 0 | 0 | — |
case-05 | fail→fail | 10,646 | 13,038 | +22% | 1 | 1 | 0% | 2,045 | 5,065 | +148% | 0 | 0 | — |
case-06 | fail→fail | 11,031 | 9,071 | -18% | 1 | 1 | 0% | 1,920 | 4,154 | +116% | 0 | 0 | — |
case-07 | pass→pass | 11,716 | 9,479 | -19% | 1 | 1 | 0% | 2,161 | 4,206 | +95% | 0 | 0 | — |
case-08 | fail→fail | 10,046 | 5,783 | -42% | 1 | 1 | 0% | 1,693 | 2,684 | +59% | 0 | 0 | — |
case-09 | fail→fail | 12,677 | 8,394 | -34% | 1 | 1 | 0% | 2,525 | 2,862 | +13% | 0 | 0 | — |
case-10 | fail→fail | 10,595 | 6,856 | -35% | 1 | 1 | 0% | 579 | 2,748 | +375% | 0 | 0 | — |
case-11 | fail→fail | 14,427 | 5,931 | -59% | 1 | 1 | 0% | 494 | 2,750 | +457% | 0 | 0 | — |
case-12 | fail→fail | 14,748 | 6,040 | -59% | 1 | 1 | 0% | 1,304 | 2,798 | +115% | 0 | 0 | — |
case-13 | fail→fail | 12,133 | 7,576 | -38% | 1 | 1 | 0% | 695 | 2,708 | +290% | 0 | 0 | — |
case-14 | fail→fail | 13,522 | 5,548 | -59% | 1 | 1 | 0% | 2,282 | 2,743 | +20% | 0 | 0 | — |
case-15 | fail→fail | 11,396 | 5,544 | -51% | 1 | 1 | 0% | 2,123 | 2,728 | +28% | 0 | 0 | — |
case-16 | fail→fail | 24,209 | 5,558 | -77% | 1 | 1 | 0% | 4,322 | 2,714 | -37% | 0 | 0 | — |
case-17 | pass→pass | 20,837 | 5,300 | -75% | 1 | 1 | 0% | 3,535 | 3,308 | -6% | 0 | 0 | — |
case-18 | fail→pass | 15,123 | 3,413 | -77% | 1 | 1 | 0% | 2,524 | 3,103 | +23% | 0 | 0 | — |
case-19 | pass→fail | 6,889 | 7,236 | +5% | 1 | 1 | 0% | 1,149 | 2,741 | +139% | 0 | 0 | — |
case-20 | fail→pass | 8,004 | 9,521 | +19% | 1 | 1 | 0% | 1,444 | 3,237 | +124% | 0 | 0 | — |
case-21 | fail→pass | 10,450 | 4,198 | -60% | 1 | 1 | 0% | 1,840 | 3,139 | +71% | 0 | 0 | — |
case-22 | pass→pass | 8,115 | 4,778 | -41% | 1 | 1 | 0% | 1,563 | 3,351 | +114% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 9 counted toward the lift figure. The other 13 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +9 percentage points is the difference between those two pass rates over the 9 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.