search
Query genes, variants, or regions in the gnomAD database to retrieve genetic variant data, population frequencies, and gene constraint scores. Supports GRCh37 and GRCh38 reference genomes for in-depth genomic analysis.
Instructions
Search for genes, variants, or regions in gnomAD
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset | No | Dataset ID (gnomad_r4, gnomad_r3, gnomad_r2_1, etc.) | gnomad_r4 |
| query | Yes | Search query (gene symbol, gene ID, variant ID, rsID, etc.) | |
| reference_genome | No | Reference genome (GRCh37 or GRCh38) | GRCh38 |
Implementation Reference
- src/index.ts:648-654 (handler)Handler logic for the 'search' tool: executes GraphQL query using searchGene template with provided query and parsed reference genome, returns search results.case "search": result = await makeGraphQLRequest(QUERIES.searchGene, { query: args.query as string, referenceGenome: parseReferenceGenome((args.reference_genome as string) || "GRCh38"), }); formattedResult = result.data?.searchResults || []; break;
- src/index.ts:418-437 (schema)Input schema for the 'search' tool defining parameters: query (required), reference_genome, and dataset.inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query (gene symbol, gene ID, variant ID, rsID, etc.)", }, reference_genome: { type: "string", description: "Reference genome (GRCh37 or GRCh38)", default: "GRCh38", }, dataset: { type: "string", description: "Dataset ID (gnomad_r4, gnomad_r3, gnomad_r2_1, etc.)", default: "gnomad_r4", }, }, required: ["query"], },
- src/index.ts:415-438 (registration)Registration of the 'search' tool in the tools list returned by ListToolsRequestHandler.{ name: "search", description: "Search for genes, variants, or regions in gnomAD", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query (gene symbol, gene ID, variant ID, rsID, etc.)", }, reference_genome: { type: "string", description: "Reference genome (GRCh37 or GRCh38)", default: "GRCh38", }, dataset: { type: "string", description: "Dataset ID (gnomad_r4, gnomad_r3, gnomad_r2_1, etc.)", default: "gnomad_r4", }, }, required: ["query"], }, },
- src/index.ts:65-72 (helper)GraphQL query template 'searchGene' used specifically by the 'search' tool handler.searchGene: ` query SearchGene($query: String!, $referenceGenome: ReferenceGenomeId!) { searchResults(query: $query, referenceGenome: $referenceGenome) { label value: url } } `,
- src/index.ts:44-61 (helper)Helper function to make GraphQL requests to the gnomAD API, invoked by the 'search' handler.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; }