Skip to main content
Glama

validate_variant_id

Validate variant identifiers and genomic coordinates to ensure accurate genetic data analysis in the GTEx Portal.

Instructions

Validate variant identifiers and genomic coordinates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
variantIdNoVariant ID to validate (rs number or variant ID)
chrNoChromosome (alternative validation method)
positionNoGenomic position (alternative validation method)

Implementation Reference

  • Core handler function that executes the validation logic for variant IDs by querying the GTEx API getVariants endpoint for each ID and categorizing valid vs invalid based on whether data is returned.
    private async validateVariantIds(variantIds: string[]) {
      const validVariants: string[] = [];
      const invalidVariants: string[] = [];
    
      // Check each variant ID individually
      for (const variantId of variantIds) {
        const result = await this.apiClient.getVariants({
          variantId: variantId,
          datasetId: 'gtex_v8',
          page: 0,
          itemsPerPage: 1
        });
    
        if (!result.error && result.data && result.data.length > 0) {
          validVariants.push(variantId);
        } else {
          invalidVariants.push(variantId);
        }
      }
    
      let output = `**Variant ID Validation Results**\n`;
      output += `Checked: ${variantIds.length} variant IDs\n\n`;
    
      if (validVariants.length > 0) {
        output += `**✅ Valid Variant IDs (${validVariants.length}):**\n`;
        validVariants.forEach(id => {
          output += `  • ${id}\n`;
        });
      }
    
      if (invalidVariants.length > 0) {
        output += `\n**❌ Invalid Variant IDs (${invalidVariants.length}):**\n`;
        invalidVariants.forEach(id => {
          output += `  • ${id}\n`;
        });
        output += `\n**Note:** Invalid IDs may be due to incorrect format or variants not present in the GTEx dataset.\n`;
      }
    
      return {
        content: [{
          type: "text",
          text: output
        }]
      };
    }
  • src/index.ts:757-762 (registration)
    Registration and dispatch logic in the main CallToolRequestHandler that routes "validate_variant_id" tool invocations to the ReferenceHandlers.validateIds method with type 'variant'.
    if (name === "validate_variant_id") {
      return await referenceHandlers.validateIds({
        ids: [args?.variantId],
        type: 'variant'
      });
    }
  • Tool schema definition including name, description, and input schema provided in the ListTools response.
    name: "validate_variant_id", 
    description: "Validate variant identifiers and genomic coordinates",
    inputSchema: {
      type: "object",
      properties: {
        variantId: {
          type: "string",
          description: "Variant ID to validate (rs number or variant ID)"
        },
        chr: {
          type: "string",
          description: "Chromosome (alternative validation method)"
        },
        position: {
          type: "integer",
          description: "Genomic position (alternative validation method)"
        }
      }
    }
  • Entry-point handler method called by the main server dispatcher; routes to variant-specific validation based on type parameter.
    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"');
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but reveals nothing about how it behaves: no information about validation criteria, error handling, output format, or whether it's a read-only operation. For a validation tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

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 maximally concise - a single 6-word phrase that captures the essence. There's no wasted language, repetition, or unnecessary elaboration. It's appropriately sized for a straightforward validation tool.

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), lack of annotations, and no output schema, the description is insufficiently complete. It doesn't explain what constitutes valid input, what validation checks are performed, what the output looks like, or error conditions. For a tool that presumably returns validation results, the description leaves too much undefined.

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 already documents all three parameters. The description adds no parameter-specific information beyond what's in the schema. It mentions 'variant identifiers and genomic coordinates' which aligns with the parameters, but provides no additional syntax, format requirements, or usage patterns. 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: 'Validate variant identifiers and genomic coordinates' - a specific verb ('validate') applied to specific resources ('variant identifiers and genomic coordinates'). It distinguishes from sibling 'validate_gene_id' by focusing on variants rather than genes. However, it doesn't specify what validation entails (format checking, existence verification, etc.), keeping it from a perfect 5.

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. There's no mention of prerequisites, when validation is needed, or how it relates to sibling tools like 'get_variants' or 'convert_coordinates'. The agent must infer usage from the name alone.

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