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' }); }

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