Skip to main content
Glama
shukwong

gnomAD MCP Server

by shukwong

get_variants_in_gene

Retrieve all genetic variants within a specific gene from the gnomAD database to analyze mutation patterns and population frequencies.

Instructions

Get all variants in a specific gene

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gene_idNoEnsembl gene ID
gene_symbolNoGene symbol
datasetNoDataset IDgnomad_r4
reference_genomeNoReference genomeGRCh38

Implementation Reference

  • Handler logic for the 'get_variants_in_gene' tool: validates input, constructs GraphQL query parameters, executes the query via makeGraphQLRequest, and extracts 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 for fetching variants in a gene, defining the input parameters and output fields.
    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
            }
          }
        }
      }
    `,
  • Input schema definition for the 'get_variants_in_gene' tool, specifying parameters and their types/descriptions.
    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",
        },
      },
    },
  • src/index.ts:480-506 (registration)
    Tool registration entry in the ListTools response, including name, description, and input schema.
    {
      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",
          },
        },
      },
    },

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