Skip to main content
Glama
shukwong

gnomAD MCP Server

by shukwong

get_mitochondrial_variants

Retrieve mitochondrial DNA variants from gnomAD to analyze genetic variations in mitochondrial genomes for research and clinical applications.

Instructions

Get mitochondrial variants

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
datasetNoDataset IDgnomad_r3

Implementation Reference

  • Handler logic for the get_mitochondrial_variants tool. It parses the dataset ID, makes a GraphQL request using the predefined mitochondrial variants query, and formats the result.
    case "get_mitochondrial_variants":
      result = await makeGraphQLRequest(QUERIES.getMitochondrialVariants, {
        datasetId: parseDatasetId((args.dataset as string) || "gnomad_r3"),
      });
      formattedResult = result.data?.mitochondrial_variants || [];
      break;
  • src/index.ts:617-630 (registration)
    Tool registration in the ListTools response, defining the name, description, and input schema for get_mitochondrial_variants.
    {
      name: "get_mitochondrial_variants",
      description: "Get mitochondrial variants",
      inputSchema: {
        type: "object",
        properties: {
          dataset: {
            type: "string",
            description: "Dataset ID",
            default: "gnomad_r3",
          },
        },
      },
    },
  • GraphQL query schema definition for retrieving mitochondrial variants, referenced as QUERIES.getMitochondrialVariants in the handler.
    getMitochondrialVariants: `
      query GetMitochondrialVariants($datasetId: DatasetId!) {
        mitochondrial_variants(dataset: $datasetId) {
          variant_id
          pos
          ref
          alt
          rsids
          ac_het
          ac_hom
          an
          af_het
          af_hom
          max_heteroplasmy
          filters
        }
      }
    `,
  • Helper function to parse and validate the dataset ID, used in the handler for get_mitochondrial_variants.
    function parseDatasetId(dataset: string): string {
      const validDatasets = [
        "gnomad_r2_1",
        "gnomad_r3",
        "gnomad_r4",
        "gnomad_sv_r2_1",
        "gnomad_sv_r4",
        "gnomad_cnv_r4",
        "exac",
      ];
      
      const datasetLower = dataset.toLowerCase();
      if (!validDatasets.includes(datasetLower)) {
        return "gnomad_r4"; // Default to latest version
      }
      return datasetLower;
    }

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