get_mitochondrial_variants
Extract mitochondrial variants from gnomAD datasets to analyze genetic variations in mitochondrial DNA. Supports dataset selection for precise querying and research applications.
Instructions
Get mitochondrial variants
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset | No | Dataset ID | gnomad_r3 |
Implementation Reference
- src/index.ts:732-737 (handler)Handler for the 'get_mitochondrial_variants' tool. Executes a GraphQL query using makeGraphQLRequest with the specified dataset to retrieve mitochondrial variants.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)Registration of the tool in the ListTools response, including name, description, and input schema.{ name: "get_mitochondrial_variants", description: "Get mitochondrial variants", inputSchema: { type: "object", properties: { dataset: { type: "string", description: "Dataset ID", default: "gnomad_r3", }, }, }, },
- src/index.ts:341-358 (schema)GraphQL query schema definition for fetching mitochondrial variants, referenced as QUERIES.getMitochondrialVariants.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 } } `,
- src/index.ts:44-61 (helper)Helper function used by the handler to perform GraphQL requests to the gnomAD API.async function makeGraphQLRequest(query: string, variables: Record<string, any> = {}): Promise<GnomadResponse> { const response: Response = await fetch(GNOMAD_API_URL, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ query, variables, }), }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return await response.json() as GnomadResponse; }