Skip to main content
Glama

get_protein_homologs

Find homologous proteins across different species using a UniProt accession number. Specify a target organism and result count to identify evolutionary relationships.

Instructions

Find homologous proteins across different species

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accessionYesUniProt accession number
organismNoTarget organism to find homologs in
sizeNoNumber of results to return (1-100, default: 25)

Implementation Reference

  • Implements the core logic for the get_protein_homologs tool. Fetches protein details by accession, constructs a search query using the protein name and optional organism filter (excluding the original protein), queries UniProt search API for homologs, and returns JSON results.
    private async handleGetProteinHomologs(args: any) {
      if (!isValidHomologArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid homolog search arguments');
      }
    
      try {
        // Get the protein info first to build a homology search
        const proteinResponse = await this.apiClient.get(`/uniprotkb/${args.accession}`, {
          params: { format: 'json' },
        });
        const protein = proteinResponse.data;
    
        // Build search query for homologs
        let query = `reviewed:true`;
        if (protein.proteinDescription?.recommendedName?.fullName?.value) {
          query += ` AND (${protein.proteinDescription.recommendedName.fullName.value})`;
        }
        if (args.organism) {
          query += ` AND organism_name:"${args.organism}"`;
        }
        query += ` NOT accession:"${args.accession}"`;
    
        const response = await this.apiClient.get('/uniprotkb/search', {
          params: {
            query: query,
            format: 'json',
            size: args.size || 25,
          },
        });
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(response.data, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error finding homologs: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • JSON schema defining the input parameters for the get_protein_homologs tool, including accession (required), optional organism, and size limits.
    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'],
    },
  • src/index.ts:741-742 (registration)
    Registers the handler function for the get_protein_homologs tool in the CallToolRequestSchema switch statement.
    case 'get_protein_homologs':
      return this.handleGetProteinHomologs(args);
  • src/index.ts:476-487 (registration)
    Registers the tool metadata, name, description, and schema in the ListToolsRequestSchema response.
      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'],
      },
    },
  • Type guard function for validating input arguments to the get_protein_homologs handler.
    const isValidHomologArgs = (
      args: any
    ): args is { accession: string; organism?: string; size?: number } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        typeof args.accession === 'string' &&
        args.accession.length > 0 &&
        (args.organism === undefined || typeof args.organism === 'string') &&
        (args.size === undefined || (typeof args.size === 'number' && args.size > 0 && args.size <= 100))
      );
    };
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. It states the action ('Find homologous proteins') but doesn't describe what the tool returns (e.g., list of homologs with scores), performance characteristics, error conditions, or data sources. This is inadequate for a tool with 3 parameters and no output schema.

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 gets straight to the point with zero wasted words. It's appropriately sized for a straightforward lookup tool and is well-structured for quick comprehension.

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?

For a tool with 3 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what constitutes a 'homolog' in this system, what data is returned, or how results are structured. The agent would be left guessing about the tool's behavior and output format.

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 fully documents all parameters. The description doesn't add any parameter-specific information beyond what's in the schema, such as explaining how 'organism' should be formatted or what 'homologous' means in this context. Baseline 3 is appropriate when schema does the heavy lifting.

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 a specific verb ('Find') and resource ('homologous proteins'), and specifies the scope ('across different species'). It distinguishes from siblings like 'get_protein_orthologs' by focusing on general homology rather than orthology, but could be more explicit about this distinction.

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 when to choose this over 'get_protein_orthologs', 'compare_proteins', or other search tools, nor does it specify prerequisites or exclusions for usage.

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