Skip to main content
Glama

search_transcripts

Find gene transcripts and isoforms using GENCODE IDs to analyze gene expression data from the GTEx Portal across human tissues.

Instructions

Search for gene transcripts and isoforms

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gencodeIdYesGENCODE gene ID (e.g., ENSG00000223972.5)
transcriptTypeNoTranscript type filter (optional)

Implementation Reference

  • The handler function getTranscripts that implements the core logic of the 'search_transcripts' tool. It validates input, fetches transcripts from the GTEx API client, sorts them, formats a detailed output with locations, lengths, types, and gene summary statistics.
    async getTranscripts(args: any) {
      if (!args.geneId || typeof args.geneId !== 'string') {
        throw new Error('geneId parameter is required and must be a GENCODE gene ID');
      }
    
      const result = await this.apiClient.getTranscripts(
        args.geneId,
        args.gencodeVersion || 'v26',
        args.genomeBuild || 'GRCh38/hg38'
      );
    
      if (result.error) {
        return {
          content: [{
            type: "text",
            text: `Error retrieving transcripts: ${result.error}`
          }],
          isError: true
        };
      }
    
      const transcripts = result.data || [];
      if (transcripts.length === 0) {
        return {
          content: [{
            type: "text",
            text: `No transcripts found for gene: ${args.geneId}`
          }]
        };
      }
    
      let output = `**Transcripts for ${transcripts[0]?.geneSymbol} (${args.geneId})**\n`;
      output += `Found ${transcripts.length} transcripts\n`;
      output += `Genome: ${transcripts[0]?.genomeBuild}, GENCODE: ${transcripts[0]?.gencodeVersion}\n\n`;
    
      // Sort transcripts by start position
      const sortedTranscripts = transcripts.sort((a, b) => a.start - b.start);
    
      sortedTranscripts.forEach((transcript, index) => {
        output += `${(index + 1).toString().padStart(2)}. **${transcript.transcriptId}**\n`;
        output += `    • Location: ${transcript.chromosome}:${transcript.start.toLocaleString()}-${transcript.end.toLocaleString()} (${transcript.strand})\n`;
        output += `    • Length: ${(transcript.end - transcript.start + 1).toLocaleString()} bp\n`;
        output += `    • Type: ${transcript.featureType}\n`;
        output += `    • Source: ${transcript.source}\n`;
      });
    
      // Calculate gene span and summary
      const geneStart = Math.min(...sortedTranscripts.map(t => t.start));
      const geneEnd = Math.max(...sortedTranscripts.map(t => t.end));
      const geneLengths = sortedTranscripts.map(t => t.end - t.start + 1);
      const avgLength = geneLengths.reduce((sum, len) => sum + len, 0) / geneLengths.length;
    
      output += `\n**Gene Summary:**\n`;
      output += `  • Gene span: ${(geneEnd - geneStart + 1).toLocaleString()} bp\n`;
      output += `  • Total transcripts: ${transcripts.length}\n`;
      output += `  • Average transcript length: ${Math.round(avgLength).toLocaleString()} bp\n`;
      output += `  • Longest transcript: ${Math.max(...geneLengths).toLocaleString()} bp\n`;
      output += `  • Shortest transcript: ${Math.min(...geneLengths).toLocaleString()} bp\n`;
    
      return {
        content: [{
          type: "text",
          text: output
        }]
      };
    }
  • The input schema definition for the 'search_transcripts' tool, specifying required gencodeId and optional transcriptType filter.
    {
      name: "search_transcripts",
      description: "Search for gene transcripts and isoforms",
      inputSchema: {
        type: "object",
        properties: {
          gencodeId: {
            type: "string",
            description: "GENCODE gene ID (e.g., ENSG00000223972.5)"
          },
          transcriptType: {
            type: "string",
            description: "Transcript type filter (optional)",
            enum: ["protein_coding", "lncRNA", "pseudogene", "miRNA"]
          }
        },
        required: ["gencodeId"]
      }
  • src/index.ts:768-772 (registration)
    The registration/dispatch code in the main CallToolRequestHandler that routes calls to 'search_transcripts' to the referenceHandlers.getTranscripts method.
    if (name === "search_transcripts") {
      return await referenceHandlers.getTranscripts({
        geneId: args?.gencodeId
      });
    }
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 but offers minimal information. It doesn't indicate whether this is a read-only operation, what format results return, if there are rate limits, authentication requirements, or pagination considerations. For a search tool with zero annotation coverage, this leaves significant behavioral unknowns.

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 at just 5 words, front-loading the essential purpose without any wasted language. Every word earns its place, making it easy to parse while conveying the core functionality.

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 lack of annotations and output schema, the description is insufficiently complete. For a search tool that presumably returns transcript/isoform data, there's no indication of what information is returned, result format, or any behavioral constraints. The description doesn't compensate for the missing structured metadata that would help an agent understand how to properly use this tool.

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 fully documents both parameters (gencodeId and transcriptType). The description adds no additional parameter context beyond what's in the schema - no examples of search patterns, no explanation of what 'search' entails versus exact matching, and no details about result filtering. Baseline 3 is appropriate when schema does all the parameter documentation.

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 verb ('search') and resource ('gene transcripts and isoforms'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'search_genes' or 'get_gene_info' - all involve gene-related data retrieval, so the specific focus on transcripts/isoforms versus other gene aspects isn't contrasted.

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 sibling tools like 'search_genes', 'get_gene_info', and 'get_gene_expression' available, there's no indication whether this tool is for transcript-level details versus gene-level information, or when transcript searching is preferable to other gene-related queries.

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