Skip to main content
Glama
Augmented-Nature

Ensembl MCP Server

get_gene_tree

Retrieve phylogenetic trees for gene families to analyze evolutionary relationships and gene function across species using Ensembl genomic data.

Instructions

Get phylogenetic tree for gene family

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gene_idYesEnsembl gene ID
speciesNoSpecies name (default: homo_sapiens)
formatNoTree format (default: json)
clusterset_idNoSpecific clusterset ID (optional)

Implementation Reference

  • The handler function for the 'get_gene_tree' tool. Validates input using isValidGeneTreeArgs, constructs Ensembl REST API request to /genetree/id/{gene_id}, handles format and clusterset_id parameters, fetches the phylogenetic tree data, and returns it as formatted text content.
    private async handleGetGeneTree(args: any) {
      if (!isValidGeneTreeArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid gene tree arguments');
      }
    
      try {
        const format = args.format || 'json';
    
        let endpoint = `/genetree/id/${args.gene_id}`;
        const params: any = {};
    
        if (args.clusterset_id) {
          params.clusterset_id = args.clusterset_id;
        }
    
        if (format !== 'json') {
          params.format = format;
        }
    
        const response = await this.apiClient.get(endpoint, { params });
    
        return {
          content: [
            {
              type: 'text',
              text: typeof response.data === 'object'
                ? JSON.stringify(response.data, null, 2)
                : String(response.data),
            },
          ],
        };
      } catch (error) {
        return this.handleError(error, 'fetching gene tree');
      }
    }
  • Input validation type guard (schema) for get_gene_tree tool arguments: requires gene_id string, optional species, format (json/newick/phyloxml), clusterset_id.
    const isValidGeneTreeArgs = (
      args: any
    ): args is { gene_id: string; species?: string; format?: string; clusterset_id?: string } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        typeof args.gene_id === 'string' &&
        args.gene_id.length > 0 &&
        (args.species === undefined || typeof args.species === 'string') &&
        (args.format === undefined || ['json', 'newick', 'phyloxml'].includes(args.format)) &&
        (args.clusterset_id === undefined || typeof args.clusterset_id === 'string')
      );
    };
  • src/index.ts:669-681 (registration)
    Tool registration definition in the listTools response, including name, description, and detailed inputSchema matching the validator.
      name: 'get_gene_tree',
      description: 'Get phylogenetic tree for gene family',
      inputSchema: {
        type: 'object',
        properties: {
          gene_id: { type: 'string', description: 'Ensembl gene ID' },
          species: { type: 'string', description: 'Species name (default: homo_sapiens)' },
          format: { type: 'string', enum: ['json', 'newick', 'phyloxml'], description: 'Tree format (default: json)' },
          clusterset_id: { type: 'string', description: 'Specific clusterset ID (optional)' },
        },
        required: ['gene_id'],
      },
    },
  • src/index.ts:851-852 (registration)
    Dispatch case in the CallToolRequestSchema switch statement that routes 'get_gene_tree' calls to the handleGetGeneTree handler.
    case 'get_gene_tree':
      return this.handleGetGeneTree(args);
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 but offers minimal information. It mentions retrieving a phylogenetic tree but doesn't specify if this is a read-only operation, requires authentication, has rate limits, or what the output entails (e.g., tree structure, metadata). For a tool with 4 parameters and no output schema, this lack of behavioral context is a significant gap.

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 that front-loads the core purpose ('Get phylogenetic tree for gene family') with zero wasted words. It avoids redundancy and is appropriately sized for the tool's complexity, making it easy to parse quickly while conveying the essential action.

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 moderate complexity (4 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what a phylogenetic tree output looks like, how it's structured, or any behavioral aspects like error handling or data sources. While the schema covers inputs well, the lack of output information and behavioral context leaves significant gaps for an AI agent to use the tool effectively.

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%, so the input schema already documents all parameters thoroughly (e.g., 'gene_id' as Ensembl gene ID, 'format' with enum values). The description adds no additional semantic context beyond implying that parameters relate to fetching a tree for a gene family. Since the schema does the heavy lifting, a baseline score of 3 is appropriate, though the description doesn't compensate for any gaps.

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 action ('Get') and resource ('phylogenetic tree for gene family'), making the purpose immediately understandable. It distinguishes this tool from siblings like 'get_homologs' or 'get_sequence' by focusing specifically on phylogenetic tree retrieval. However, it doesn't explicitly mention what a 'gene family' entails or how it relates to the input parameters, keeping 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. For example, it doesn't clarify if this should be used instead of 'get_homologs' for evolutionary analysis or how it differs from 'batch_gene_lookup' for gene information. Without any context on prerequisites, typical use cases, or comparisons to sibling tools, users must infer usage from the tool 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/Ensembl-MCP-Server'

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