Skip to main content
Glama
shukwong
by shukwong

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
NameRequiredDescriptionDefault
datasetNoDataset IDgnomad_r4
gene_idNoEnsembl gene ID
gene_symbolNoGene symbol
reference_genomeNoReference genomeGRCh38

Implementation Reference

  • 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;
  • 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", }, }, }, },

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shukwong/gnomad-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server