Skip to main content
Glama
shukwong

gnomAD MCP Server

by shukwong

get_gene

Retrieve detailed gene information including constraint scores from gnomAD database to analyze genetic variants and population frequencies.

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 handler. It validates that either gene_id or gene_symbol is provided, then executes a GraphQL request using the predefined getGene query and parses the reference genome.
    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 for the 'get_gene' tool, defining the expected parameters: gene_id (optional), gene_symbol (optional), and reference_genome (optional with default).
    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:440-460 (registration)
    Registration of the 'get_gene' tool in the ListToolsRequestSchema response, including 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 get_gene handler to fetch detailed gene information including constraint metrics 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 make GraphQL requests to the gnomAD API, used by the get_gene 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;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. It mentions 'detailed information' and 'constraint scores' but doesn't specify what other details are included, response format, error conditions, or any operational constraints like rate limits or authentication needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core purpose and includes a specific data element ('constraint scores') that adds value without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a tool that returns 'detailed information'. It doesn't specify what details beyond constraint scores are included, the response structure, or how to handle the optional parameters, leaving significant gaps for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all three parameters. The description adds no parameter-specific information beyond implying gene identification is needed, which is already clear from the schema. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('detailed information about a gene'), including a key data element ('constraint scores'). It distinguishes from siblings like 'get_variant' or 'get_transcript' by focusing on gene-level information, though it doesn't explicitly name these alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_variants_in_gene' or 'search' available, there's no indication of when gene-level details are preferred over variant-level or search-based approaches, leaving usage context unclear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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