Skip to main content
Glama
shukwong
by shukwong

get_gene

Retrieve comprehensive gene details, including constraint scores, using Ensembl gene ID or gene symbol. Supports GRCh37 and GRCh38 reference genomes.

Instructions

Get detailed information about a gene including constraint scores

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gene_idNoEnsembl gene ID (e.g., ENSG00000141510)
gene_symbolNoGene symbol (e.g., TP53)
reference_genomeNoReference genome (GRCh37 or GRCh38)GRCh38

Implementation Reference

  • The handler logic for the 'get_gene' tool within the CallToolRequestSchema switch statement. It validates that either gene_id or gene_symbol is provided, constructs the GraphQL variables, calls makeGraphQLRequest with the QUERIES.getGene template, and sets the formatted result from the gene data.
    case "get_gene": if (!args.gene_id && !args.gene_symbol) { throw new Error("Either gene_id or gene_symbol must be provided"); } result = await makeGraphQLRequest(QUERIES.getGene, { geneId: (args.gene_id as string) || null, geneSymbol: (args.gene_symbol as string) || null, referenceGenome: parseReferenceGenome((args.reference_genome as string) || "GRCh38"), }); formattedResult = result.data?.gene || null; break;
  • Input schema (JSON Schema) for the 'get_gene' tool, defining parameters: gene_id (optional), gene_symbol (optional, one required), reference_genome (optional, defaults to GRCh38). Used for validation in MCP.
    inputSchema: { type: "object", properties: { gene_id: { type: "string", description: "Ensembl gene ID (e.g., ENSG00000141510)", }, gene_symbol: { type: "string", description: "Gene symbol (e.g., TP53)", }, reference_genome: { type: "string", description: "Reference genome (GRCh37 or GRCh38)", default: "GRCh38", }, }, },
  • src/index.ts:439-460 (registration)
    Registration of the 'get_gene' tool in the ListToolsRequestSchema response. Includes name, description, and input schema.
    { name: "get_gene", description: "Get detailed information about a gene including constraint scores", inputSchema: { type: "object", properties: { gene_id: { type: "string", description: "Ensembl gene ID (e.g., ENSG00000141510)", }, gene_symbol: { type: "string", description: "Gene symbol (e.g., TP53)", }, reference_genome: { type: "string", description: "Reference genome (GRCh37 or GRCh38)", default: "GRCh38", }, }, }, },
  • GraphQL query template QUERIES.getGene used by the handler to fetch detailed gene information from gnomAD, including location, constraint metrics (pLI, oe_lof, etc.), and transcripts.
    getGene: ` query GetGene($geneId: String, $geneSymbol: String, $referenceGenome: ReferenceGenomeId!) { gene(gene_id: $geneId, gene_symbol: $geneSymbol, reference_genome: $referenceGenome) { gene_id symbol name canonical_transcript_id hgnc_id omim_id chrom start stop strand gnomad_constraint { exp_lof exp_mis exp_syn obs_lof obs_mis obs_syn oe_lof oe_lof_lower oe_lof_upper oe_mis oe_mis_lower oe_mis_upper oe_syn oe_syn_lower oe_syn_upper lof_z mis_z syn_z pLI } transcripts { transcript_id transcript_version reference_genome } } } `,
  • Helper function to perform GraphQL POST requests to the gnomAD API endpoint, handling fetch, error checking, and JSON parsing. Used by all tool handlers including get_gene.
    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; }

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