Forge Tools pharmgkb

pharmgkb read

scidex.forge.pharmgkb

Query PharmGKB for pharmacogenomics gene-drug-variant associations. Returns curated evidence on how genetic variants affect drug response, dosing, and toxicity. Evidence levels: 1A (clinical guideline) to 4 (case report). Covers CYP enzymes, transporter genes, and more. Public API — no auth required.

HTTP: POST /api/scidex/forge/pharmgkb

Invoke

Calls scidex.tool.invoke on the substrate with this tool name. Edit the JSON below — it must match the input schema. The substrate runs the tool, records the call in substrate_tool_calls, and returns a structured envelope.

Sign in to invoke this tool. Schema and curl snippet are visible to anyone.

Schemas

Input schema
{
  "additionalProperties": false,
  "description": "Input schema for ``scidex.forge.pharmgkb``.",
  "properties": {
    "gene_symbols": {
      "description": "1-5 HGNC gene symbols to query (e.g. ``['CYP2D6', 'TPMT']``). Results are combined across all genes.",
      "items": {
        "type": "string"
      },
      "title": "Gene Symbols",
      "type": "array"
    },
    "drug_name": {
      "anyOf": [
        {
          "maxLength": 200,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional drug name filter (e.g. ``'warfarin'``). Case-insensitive partial match against drug names.",
      "title": "Drug Name"
    },
    "evidence_level": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Filter to a specific PharmGKB evidence level. One of: '1A' (clinical guideline), '1B' (labeling), '2A', '2B' (variant-specific), '3' (case/control), '4' (case report).",
      "title": "Evidence Level"
    },
    "limit": {
      "default": 20,
      "description": "Maximum number of associations to return.",
      "maximum": 100,
      "minimum": 1,
      "title": "Limit",
      "type": "integer"
    }
  },
  "required": [
    "gene_symbols"
  ],
  "title": "ForgePharmGKBIn",
  "type": "object"
}
Output schema
{
  "$defs": {
    "PharmGKBAssociation": {
      "description": "One gene-drug-variant association, flattened for the verb surface.",
      "properties": {
        "gene_symbol": {
          "description": "HGNC gene symbol (e.g. CYP2D6).",
          "title": "Gene Symbol",
          "type": "string"
        },
        "drug_name": {
          "default": "",
          "description": "Drug common name.",
          "title": "Drug Name",
          "type": "string"
        },
        "drug_id": {
          "default": "",
          "description": "PharmGKB drug accession ID (PA* format).",
          "title": "Drug Id",
          "type": "string"
        },
        "variant_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Variant rs ID if annotation is variant-specific.",
          "title": "Variant Id"
        },
        "phenotype": {
          "default": "",
          "description": "Pharmacogenomics phenotype (Efficacy, Toxicity, Metabolism, etc.).",
          "title": "Phenotype",
          "type": "string"
        },
        "evidence_level": {
          "default": "",
          "description": "PharmGKB evidence level: 1A (clinical guideline, highest) to 4 (case report).",
          "title": "Evidence Level",
          "type": "string"
        },
        "pmids": {
          "description": "PubMed IDs of supporting publications.",
          "items": {
            "type": "string"
          },
          "title": "Pmids",
          "type": "array"
        },
        "annotation_id": {
          "default": "",
          "description": "PharmGKB clinical annotation ID.",
          "title": "Annotation Id",
          "type": "string"
        }
      },
      "required": [
        "gene_symbol"
      ],
      "title": "PharmGKBAssociation",
      "type": "object"
    }
  },
  "description": "Response shape for ``scidex.forge.pharmgkb``.",
  "properties": {
    "associations": {
      "items": {
        "$ref": "#/$defs/PharmGKBAssociation"
      },
      "title": "Associations",
      "type": "array"
    },
    "genes_found": {
      "default": 0,
      "description": "Number of queried gene symbols found in PharmGKB.",
      "title": "Genes Found",
      "type": "integer"
    },
    "returned": {
      "description": "Length of ``associations``.",
      "title": "Returned",
      "type": "integer"
    },
    "took_ms": {
      "description": "Wall-clock time for the upstream calls.",
      "title": "Took Ms",
      "type": "integer"
    }
  },
  "required": [
    "returned",
    "took_ms"
  ],
  "title": "ForgePharmGKBOut",
  "type": "object"
}

curl snippet

Replace $SCIDEX_JWT with a valid bearer token. Read verbs are usually accessible without auth in dev; production requires a JWT.

curl -sS -X POST '/api/scidex/forge/pharmgkb' \
  -H 'authorization: Bearer $SCIDEX_JWT' \
  -H 'content-type: application/json' \
  -d '{
  "gene_symbols": []
}'

Discussion

Posting anonymously. Sign in for attribution.

No comments yet — be the first.