Skip to main content
Glama

validate_gene_id

Validate and normalize gene identifiers (GENCODE IDs or gene symbols) for accurate genomics data analysis in GTEx Portal queries.

Instructions

Validate and normalize gene identifiers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geneIdYesGene ID to validate (GENCODE ID or gene symbol)

Implementation Reference

  • Core handler function validateGeneIds that implements the validation logic by calling GTEx API's getGenes method and categorizing IDs as valid or invalid based on whether they return gene data.
    private async validateGeneIds(geneIds: string[]) {
      const validGenes: string[] = [];
      const invalidGenes: string[] = [];
    
      // Try to get information for all gene IDs
      const result = await this.apiClient.getGenes(geneIds, 'v26', 'GRCh38/hg38');
      
      if (!result.error && result.data) {
        const foundGenes = result.data.map(gene => gene.gencodeId || gene.geneSymbol);
        
        geneIds.forEach(id => {
          if (foundGenes.some(foundId => foundId.toLowerCase() === id.toLowerCase())) {
            validGenes.push(id);
          } else {
            invalidGenes.push(id);
          }
        });
      } else {
        // If API call fails, mark all as invalid
        invalidGenes.push(...geneIds);
      }
    
      let output = `**Gene ID Validation Results**\n`;
      output += `Checked: ${geneIds.length} gene IDs\n\n`;
    
      if (validGenes.length > 0) {
        output += `**✅ Valid Gene IDs (${validGenes.length}):**\n`;
        validGenes.forEach(id => {
          output += `  • ${id}\n`;
        });
      }
    
      if (invalidGenes.length > 0) {
        output += `\n**❌ Invalid Gene IDs (${invalidGenes.length}):**\n`;
        invalidGenes.forEach(id => {
          output += `  • ${id}\n`;
        });
        output += `\n**Note:** Invalid IDs may be due to incorrect format, obsolete IDs, or typos.\n`;
      }
    
      return {
        content: [{
          type: "text",
          text: output
        }]
      };
    }
  • Public handler method validateIds that is called by the tool dispatcher; routes gene validation to private validateGeneIds method.
    async validateIds(args: any) {
      if (!args.ids || !Array.isArray(args.ids) || args.ids.length === 0) {
        throw new Error('ids parameter is required and must be a non-empty array of IDs to validate');
      }
    
      const idType = args.type || 'gene'; // 'gene' or 'variant'
      
      if (idType === 'gene') {
        return await this.validateGeneIds(args.ids);
      } else if (idType === 'variant') {
        return await this.validateVariantIds(args.ids);
      } else {
        throw new Error('type parameter must be either "gene" or "variant"');
      }
    }
  • Input schema definition for the validate_gene_id tool, specifying required geneId parameter.
    {
      name: "validate_gene_id",
      description: "Validate and normalize gene identifiers",
      inputSchema: {
        type: "object",
        properties: {
          geneId: {
            type: "string",
            description: "Gene ID to validate (GENCODE ID or gene symbol)"
          }
        },
        required: ["geneId"]
      }
    },
  • src/index.ts:751-756 (registration)
    Tool registration and dispatch logic in main server handler that maps validate_gene_id calls to ReferenceHandlers.validateIds with type 'gene'.
    if (name === "validate_gene_id") {
      return await referenceHandlers.validateIds({
        ids: [args?.geneId],
        type: 'gene'
      });
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool validates and normalizes, implying it might return standardized identifiers, but doesn't describe what validation entails (e.g., checks for format, existence, or mapping), what normalization does (e.g., converts to a standard format), or any error handling. This is inadequate for a tool with potential behavioral complexity.

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 extremely concise and front-loaded with a single, clear sentence: 'Validate and normalize gene identifiers'. There is no wasted text, and it efficiently communicates the core purpose 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 the tool's purpose (validation and normalization), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what validation checks are performed, what normalization outputs look like, or any behavioral traits (e.g., whether it's idempotent or has side effects). For a tool that could involve complex logic, this leaves significant gaps.

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?

The schema description coverage is 100%, with the parameter 'geneId' fully documented in the schema as 'Gene ID to validate (GENCODE ID or gene symbol)'. The description adds no additional parameter information beyond what the schema provides, so it meets the baseline of 3 for high schema coverage without extra value.

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: 'Validate and normalize gene identifiers'. It specifies the action (validate and normalize) and the resource (gene identifiers). However, it doesn't explicitly differentiate from sibling tools like 'validate_variant_id' or 'search_genes', which reduces it from a perfect score.

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. It doesn't mention when validation is needed (e.g., before analysis), what makes it different from 'search_genes' or 'validate_variant_id', or any prerequisites. This leaves the agent without context for tool selection.

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/Augmented-Nature/GTEx-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server