Skip to main content
Glama
Augmented-Nature

Ensembl MCP Server

get_transcripts

Retrieve detailed transcript structures for a specific gene, including exons, introns, and coding sequences, to analyze gene expression and alternative splicing patterns.

Instructions

Get all transcripts for a gene with detailed structure

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gene_idYesEnsembl gene ID
speciesNoSpecies name (default: homo_sapiens)
canonical_onlyNoReturn only canonical transcript (default: false)

Implementation Reference

  • The handler function for the 'get_transcripts' tool. Validates input, queries Ensembl REST API for gene with expanded transcripts, filters optionally for canonical transcripts, and returns formatted JSON with gene info and transcripts.
    private async handleGetTranscripts(args: any) {
      if (!isValidTranscriptArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid transcript arguments');
      }
    
      try {
        const species = this.getDefaultSpecies(args.species);
        const response = await this.apiClient.get(`/lookup/id/${args.gene_id}`, {
          params: { species, expand: 1 },
        });
    
        const gene = response.data;
        let transcripts = gene.Transcript || [];
    
        if (args.canonical_only) {
          transcripts = transcripts.filter((t: any) => t.is_canonical === 1);
        }
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                gene_id: gene.id,
                gene_name: gene.display_name,
                transcript_count: transcripts.length,
                transcripts: transcripts,
              }, null, 2),
            },
          ],
        };
      } catch (error) {
        return this.handleError(error, 'fetching transcripts');
      }
    }
  • src/index.ts:584-595 (registration)
    Registration of the 'get_transcripts' tool in the ListToolsRequestSchema handler, providing name, description, and input schema.
      name: 'get_transcripts',
      description: 'Get all transcripts for a gene with detailed structure',
      inputSchema: {
        type: 'object',
        properties: {
          gene_id: { type: 'string', description: 'Ensembl gene ID' },
          species: { type: 'string', description: 'Species name (default: homo_sapiens)' },
          canonical_only: { type: 'boolean', description: 'Return only canonical transcript (default: false)' },
        },
        required: ['gene_id'],
      },
    },
  • src/index.ts:838-839 (registration)
    Routes calls to the 'get_transcripts' tool to its handler function in the CallToolRequestSchema switch statement.
      return this.handleGetTranscripts(args);
    case 'search_genes':
  • Type guard function for validating input arguments to the 'get_transcripts' tool.
    const isValidTranscriptArgs = (
      args: any
    ): args is { gene_id: string; species?: string; canonical_only?: boolean } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        typeof args.gene_id === 'string' &&
        args.gene_id.length > 0 &&
        (args.species === undefined || typeof args.species === 'string') &&
        (args.canonical_only === undefined || typeof args.canonical_only === 'boolean')
      );
    };
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'detailed structure,' hinting at rich output, but doesn't specify what that includes (e.g., exon-intron boundaries, UTRs, coding sequences) or behavioral traits like rate limits, error handling, or data freshness. For a tool with no annotations, this leaves significant gaps in understanding how it operates beyond basic functionality.

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: 'Get all transcripts for a gene with detailed structure.' It is front-loaded with the core action and resource, with no wasted words. Every part earns its place by clarifying scope ('all transcripts') and output quality ('detailed structure'), making it highly concise and well-structured.

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 complexity (3 parameters, no annotations, no output schema), the description is incomplete. It lacks details on output format (e.g., JSON structure, fields included), error cases (e.g., invalid gene IDs), and behavioral context (e.g., performance, limitations). For a tool that retrieves biological data with potential nuances, more completeness is needed to guide effective use.

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%, with all parameters well-documented in the input schema (e.g., 'gene_id' as Ensembl gene ID, 'species' with default, 'canonical_only' as boolean). The description adds no additional parameter semantics beyond what the schema provides, such as format examples or constraints. Baseline 3 is appropriate since the schema does the heavy lifting, but the description doesn't compensate with extra insights.

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: 'Get all transcripts for a gene with detailed structure.' It specifies the verb ('Get'), resource ('transcripts'), and scope ('for a gene'), distinguishing it from siblings like 'get_sequence' or 'lookup_gene' that handle different data types. However, it doesn't explicitly differentiate from 'get_cds_sequence' or 'translate_sequence', which are also transcript-related but focus on specific aspects rather than comprehensive transcript details.

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 prerequisites (e.g., needing a valid gene ID), exclusions (e.g., not for non-coding genes), or comparisons to siblings like 'batch_gene_lookup' for multiple genes or 'get_variant_consequences' for variant effects on transcripts. Usage is implied by the purpose but lacks explicit context.

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/Ensembl-MCP-Server'

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