get_variants_in_gene
Retrieve all genetic variants within a specified gene using Ensembl ID or gene symbol. Access variant data from gnomAD datasets and analyze population-level genetic information.
Instructions
Get all variants in a specific gene
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset | No | Dataset ID | gnomad_r4 |
| gene_id | No | Ensembl gene ID | |
| gene_symbol | No | Gene symbol | |
| reference_genome | No | Reference genome | GRCh38 |
Implementation Reference
- src/index.ts:676-687 (handler)Handler logic for the 'get_variants_in_gene' tool. Validates input, calls makeGraphQLRequest with the appropriate query and variables, and extracts the variants from the response.case "get_variants_in_gene": if (!args.gene_id && !args.gene_symbol) { throw new Error("Either gene_id or gene_symbol must be provided"); } result = await makeGraphQLRequest(QUERIES.getVariantsInGene, { geneId: (args.gene_id as string) || null, geneSymbol: (args.gene_symbol as string) || null, datasetId: parseDatasetId((args.dataset as string) || "gnomad_r4"), referenceGenome: parseReferenceGenome((args.reference_genome as string) || "GRCh38"), }); formattedResult = result.data?.gene?.variants || []; break;
- src/index.ts:188-214 (schema)GraphQL query schema definition for fetching variants within a specified gene, used by the tool handler.getVariantsInGene: ` query GetVariantsInGene($geneId: String, $geneSymbol: String, $datasetId: DatasetId!, $referenceGenome: ReferenceGenomeId!) { gene(gene_id: $geneId, gene_symbol: $geneSymbol, reference_genome: $referenceGenome) { variants(dataset: $datasetId) { variant_id pos rsids consequence hgvsc hgvsp lof exome { ac an af filters } genome { ac an af filters } } } } `,
- src/index.ts:480-506 (registration)Tool registration in the listTools response, including name, description, and input schema validation.{ name: "get_variants_in_gene", description: "Get all variants in a specific gene", inputSchema: { type: "object", properties: { gene_id: { type: "string", description: "Ensembl gene ID", }, gene_symbol: { type: "string", description: "Gene symbol", }, dataset: { type: "string", description: "Dataset ID", default: "gnomad_r4", }, reference_genome: { type: "string", description: "Reference genome", default: "GRCh38", }, }, }, },