Skip to main content
Glama

get_phylogenetic_info

Retrieve evolutionary relationships and phylogenetic data for proteins using UniProt accession numbers to analyze biological evolution and protein families.

Instructions

Retrieve evolutionary relationships and phylogenetic data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accessionYesUniProt accession number

Implementation Reference

  • The main handler function for the 'get_phylogenetic_info' tool. It validates input, fetches detailed protein information from the UniProt REST API, extracts relevant phylogenetic data (organism, lineage, evolutionary origin, phylogenetic range comments), formats it as JSON, and returns it.
    private async handleGetPhylogeneticInfo(args: any) {
      if (!isValidProteinInfoArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid phylogenetic info arguments');
      }
    
      try {
        const response = await this.apiClient.get(`/uniprotkb/${args.accession}`, {
          params: { format: 'json' },
        });
    
        const protein = response.data;
        const phylogeneticInfo = {
          accession: protein.primaryAccession,
          organism: protein.organism,
          taxonomicLineage: protein.organism?.lineage || [],
          evolutionaryOrigin: protein.comments?.filter((c: any) => c.commentType === 'EVOLUTIONARY ORIGIN') || [],
          phylogeneticRange: protein.comments?.filter((c: any) => c.commentType === 'PHYLOGENETIC RANGE') || [],
        };
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(phylogeneticInfo, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error fetching phylogenetic info: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • The tool schema definition including name, description, and input schema (requires UniProt accession). This is returned by the ListTools handler.
    name: 'get_phylogenetic_info',
    description: 'Retrieve evolutionary relationships and phylogenetic data',
    inputSchema: {
      type: 'object',
      properties: {
        accession: { type: 'string', description: 'UniProt accession number' },
      },
      required: ['accession'],
    },
  • src/index.ts:744-747 (registration)
    Registration of the tool handler in the CallToolRequestSchema switch statement, mapping the tool name to its handler method.
      return this.handleGetProteinOrthologs(args);
    case 'get_phylogenetic_info':
      return this.handleGetPhylogeneticInfo(args);
    // Structure & Function Analysis Tools
  • Helper validation function used by the handler to validate input arguments (accession and optional format).
    const isValidProteinInfoArgs = (
      args: any
    ): args is { accession: string; format?: string } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        typeof args.accession === 'string' &&
        args.accession.length > 0 &&
        (args.format === undefined || ['json', 'tsv', 'fasta', 'xml'].includes(args.format))
      );
    };
  • src/index.ts:397-721 (registration)
    Overall tool registration in setupToolHandlers where all tools including get_phylogenetic_info are listed with their schemas for the ListTools endpoint.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        // Original tools
        {
          name: 'search_proteins',
          description: 'Search UniProt database for proteins by name, keyword, or organism',
          inputSchema: {
            type: 'object',
            properties: {
              query: { type: 'string', description: 'Search query (protein name, keyword, or complex search)' },
              organism: { type: 'string', description: 'Organism name or taxonomy ID to filter results' },
              size: { type: 'number', description: 'Number of results to return (1-500, default: 25)', minimum: 1, maximum: 500 },
              format: { type: 'string', enum: ['json', 'tsv', 'fasta', 'xml'], description: 'Output format (default: json)' },
            },
            required: ['query'],
          },
        },
        {
          name: 'get_protein_info',
          description: 'Get detailed information for a specific protein by UniProt accession',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number (e.g., P04637)' },
              format: { type: 'string', enum: ['json', 'tsv', 'fasta', 'xml'], description: 'Output format (default: json)' },
            },
            required: ['accession'],
          },
        },
        {
          name: 'search_by_gene',
          description: 'Search for proteins by gene name or symbol',
          inputSchema: {
            type: 'object',
            properties: {
              gene: { type: 'string', description: 'Gene name or symbol (e.g., BRCA1, INS)' },
              organism: { type: 'string', description: 'Organism name or taxonomy ID to filter results' },
              size: { type: 'number', description: 'Number of results to return (1-500, default: 25)', minimum: 1, maximum: 500 },
            },
            required: ['gene'],
          },
        },
        {
          name: 'get_protein_sequence',
          description: 'Get the amino acid sequence for a protein',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number' },
              format: { type: 'string', enum: ['fasta', 'json'], description: 'Output format (default: fasta)' },
            },
            required: ['accession'],
          },
        },
        {
          name: 'get_protein_features',
          description: 'Get functional features and domains for a protein',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number' },
            },
            required: ['accession'],
          },
        },
        // Comparative & Evolutionary Analysis Tools
        {
          name: 'compare_proteins',
          description: 'Compare multiple proteins side-by-side with sequence and feature comparison',
          inputSchema: {
            type: 'object',
            properties: {
              accessions: { type: 'array', items: { type: 'string' }, description: 'Array of UniProt accession numbers (2-10)', minItems: 2, maxItems: 10 },
              format: { type: 'string', enum: ['json', 'tsv'], description: 'Output format (default: json)' },
            },
            required: ['accessions'],
          },
        },
        {
          name: 'get_protein_homologs',
          description: 'Find homologous proteins across different species',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number' },
              organism: { type: 'string', description: 'Target organism to find homologs in' },
              size: { type: 'number', description: 'Number of results to return (1-100, default: 25)', minimum: 1, maximum: 100 },
            },
            required: ['accession'],
          },
        },
        {
          name: 'get_protein_orthologs',
          description: 'Identify orthologous proteins for evolutionary studies',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number' },
              organism: { type: 'string', description: 'Target organism to find orthologs in' },
              size: { type: 'number', description: 'Number of results to return (1-100, default: 25)', minimum: 1, maximum: 100 },
            },
            required: ['accession'],
          },
        },
        {
          name: 'get_phylogenetic_info',
          description: 'Retrieve evolutionary relationships and phylogenetic data',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number' },
            },
            required: ['accession'],
          },
        },
        // Structure & Function Analysis Tools
        {
          name: 'get_protein_structure',
          description: 'Retrieve 3D structure information from PDB references',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number' },
            },
            required: ['accession'],
          },
        },
        {
          name: 'get_protein_domains_detailed',
          description: 'Enhanced domain analysis with InterPro, Pfam, and SMART annotations',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number' },
            },
            required: ['accession'],
          },
        },
        {
          name: 'get_protein_variants',
          description: 'Disease-associated variants and mutations',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number' },
            },
            required: ['accession'],
          },
        },
        {
          name: 'analyze_sequence_composition',
          description: 'Amino acid composition, hydrophobicity, and other sequence properties',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number' },
            },
            required: ['accession'],
          },
        },
        // Biological Context Tools
        {
          name: 'get_protein_pathways',
          description: 'Associated biological pathways (KEGG, Reactome)',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number' },
            },
            required: ['accession'],
          },
        },
        {
          name: 'get_protein_interactions',
          description: 'Protein-protein interaction networks',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number' },
            },
            required: ['accession'],
          },
        },
        {
          name: 'search_by_function',
          description: 'Search proteins by GO terms or functional annotations',
          inputSchema: {
            type: 'object',
            properties: {
              goTerm: { type: 'string', description: 'Gene Ontology term (e.g., GO:0005524)' },
              function: { type: 'string', description: 'Functional description or keyword' },
              organism: { type: 'string', description: 'Organism name or taxonomy ID to filter results' },
              size: { type: 'number', description: 'Number of results to return (1-500, default: 25)', minimum: 1, maximum: 500 },
            },
            required: [],
          },
        },
        {
          name: 'search_by_localization',
          description: 'Find proteins by subcellular localization',
          inputSchema: {
            type: 'object',
            properties: {
              localization: { type: 'string', description: 'Subcellular localization (e.g., nucleus, mitochondria)' },
              organism: { type: 'string', description: 'Organism name or taxonomy ID to filter results' },
              size: { type: 'number', description: 'Number of results to return (1-500, default: 25)', minimum: 1, maximum: 500 },
            },
            required: ['localization'],
          },
        },
        // Batch Processing & Advanced Search
        {
          name: 'batch_protein_lookup',
          description: 'Process multiple accessions efficiently',
          inputSchema: {
            type: 'object',
            properties: {
              accessions: { type: 'array', items: { type: 'string' }, description: 'Array of UniProt accession numbers (1-100)', minItems: 1, maxItems: 100 },
              format: { type: 'string', enum: ['json', 'tsv', 'fasta'], description: 'Output format (default: json)' },
            },
            required: ['accessions'],
          },
        },
        {
          name: 'advanced_search',
          description: 'Complex queries with multiple filters (length, mass, organism, function)',
          inputSchema: {
            type: 'object',
            properties: {
              query: { type: 'string', description: 'Base search query' },
              organism: { type: 'string', description: 'Organism name or taxonomy ID' },
              minLength: { type: 'number', description: 'Minimum sequence length', minimum: 1 },
              maxLength: { type: 'number', description: 'Maximum sequence length' },
              minMass: { type: 'number', description: 'Minimum molecular mass (Da)', minimum: 1 },
              maxMass: { type: 'number', description: 'Maximum molecular mass (Da)' },
              keywords: { type: 'array', items: { type: 'string' }, description: 'Array of keywords to include' },
              size: { type: 'number', description: 'Number of results to return (1-500, default: 25)', minimum: 1, maximum: 500 },
            },
            required: [],
          },
        },
        {
          name: 'search_by_taxonomy',
          description: 'Search by detailed taxonomic classification',
          inputSchema: {
            type: 'object',
            properties: {
              taxonomyId: { type: 'number', description: 'NCBI taxonomy ID', minimum: 1 },
              taxonomyName: { type: 'string', description: 'Taxonomic name (e.g., Mammalia, Bacteria)' },
              size: { type: 'number', description: 'Number of results to return (1-500, default: 25)', minimum: 1, maximum: 500 },
            },
            required: [],
          },
        },
        // Cross-Reference & Literature Tools
        {
          name: 'get_external_references',
          description: 'Links to other databases (PDB, EMBL, RefSeq, etc.)',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number' },
            },
            required: ['accession'],
          },
        },
        {
          name: 'get_literature_references',
          description: 'Associated publications and citations',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number' },
            },
            required: ['accession'],
          },
        },
        {
          name: 'get_annotation_confidence',
          description: 'Quality scores for different annotations',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number' },
            },
            required: ['accession'],
          },
        },
        // Export & Utility Tools
        {
          name: 'export_protein_data',
          description: 'Export data in specialized formats (GFF, GenBank, etc.)',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number' },
              format: { type: 'string', enum: ['gff', 'genbank', 'embl', 'xml'], description: 'Export format' },
            },
            required: ['accession', 'format'],
          },
        },
        {
          name: 'validate_accession',
          description: 'Check if accession numbers are valid',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number to validate' },
            },
            required: ['accession'],
          },
        },
        {
          name: 'get_taxonomy_info',
          description: 'Detailed taxonomic information for organisms',
          inputSchema: {
            type: 'object',
            properties: {
              accession: { type: 'string', description: 'UniProt accession number' },
            },
            required: ['accession'],
          },
        },
      ],
    }));
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. It states the tool 'retrieves' data, implying a read-only operation, but doesn't specify whether it's idempotent, has rate limits, requires authentication, or what the return format looks like. This is inadequate for a tool with potential complexity in phylogenetic data.

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 with no wasted words. It's front-loaded with the core purpose and appropriately sized for a simple retrieval 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 lack of annotations and output schema, the description is incomplete. It doesn't explain what 'phylogenetic data' includes (e.g., tree formats, confidence scores) or behavioral aspects like error handling. For a tool dealing with evolutionary relationships, more context is needed to use it 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 input schema has 100% description coverage, with the single parameter 'accession' documented as a 'UniProt accession number'. The description doesn't add any additional meaning beyond this, such as format examples or constraints, so it meets the baseline for high schema coverage.

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 with specific verbs ('retrieve') and resources ('evolutionary relationships and phylogenetic data'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'get_taxonomy_info' or 'get_protein_homologs' which might also relate to evolutionary data.

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, context, or exclusions, leaving the agent to infer usage from the tool name and parameters 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/UniProt-MCP-Server'

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