Skip to main content
Glama
Augmented-Nature

STRING-db MCP Server

get_protein_annotations

Retrieve detailed functional information and annotations for specified proteins using the STRING database to support biological research and analysis.

Instructions

Get detailed annotations and functional information for proteins

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
protein_idsYesList of protein identifiers
speciesNoSpecies name or NCBI taxonomy ID (default: 9606 for human)

Implementation Reference

  • The handler function executes the tool logic: validates args, fetches annotations from STRING API endpoint '/tsv/get_string_ids', parses TSV response using parseTsvData, formats and returns JSON with protein details.
    private async handleGetProteinAnnotations(args: any) {
      if (!isValidNetworkArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid protein annotation arguments');
      }
    
      try {
        const species = args.species || '9606';
    
        const response = await this.apiClient.get('/tsv/get_string_ids', {
          params: {
            identifiers: args.protein_ids.join('%0d'),
            species: species,
          },
        });
    
        const annotations = this.parseTsvData<ProteinAnnotation>(response.data);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                species: species,
                proteins: annotations.map(protein => ({
                  query_id: protein.preferredName,
                  string_id: protein.stringId,
                  preferred_name: protein.preferredName,
                  ncbi_taxon_id: protein.ncbiTaxonId,
                  annotation: protein.annotation,
                  protein_size: protein.protein_size,
                }))
              }, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error fetching protein annotations: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema definition for the get_protein_annotations tool, specifying protein_ids as required array of strings and optional species string.
    {
      name: 'get_protein_annotations',
      description: 'Get detailed annotations and functional information for proteins',
      inputSchema: {
        type: 'object',
        properties: {
          protein_ids: { type: 'array', items: { type: 'string' }, description: 'List of protein identifiers' },
          species: { type: 'string', description: 'Species name or NCBI taxonomy ID (default: 9606 for human)' },
        },
        required: ['protein_ids'],
      },
  • src/index.ts:401-402 (registration)
    Dispatch case in the MCP tool request handler switch statement that routes calls to get_protein_annotations to its handler function.
    case 'get_protein_annotations':
      return this.handleGetProteinAnnotations(args);
  • src/index.ts:340-389 (registration)
    Tool registration via server.setTools() including the get_protein_annotations tool definition.
          inputSchema: {
            type: 'object',
            properties: {
              protein_ids: { type: 'array', items: { type: 'string' }, description: 'List of protein identifiers' },
              species: { type: 'string', description: 'Species name or NCBI taxonomy ID (default: 9606 for human)' },
              background_string_identifiers: { type: 'array', items: { type: 'string' }, description: 'Background protein set for enrichment (optional)' },
            },
            required: ['protein_ids'],
          },
        },
        {
          name: 'get_protein_annotations',
          description: 'Get detailed annotations and functional information for proteins',
          inputSchema: {
            type: 'object',
            properties: {
              protein_ids: { type: 'array', items: { type: 'string' }, description: 'List of protein identifiers' },
              species: { type: 'string', description: 'Species name or NCBI taxonomy ID (default: 9606 for human)' },
            },
            required: ['protein_ids'],
          },
        },
        {
          name: 'find_homologs',
          description: 'Find homologous proteins across different species',
          inputSchema: {
            type: 'object',
            properties: {
              protein_id: { type: 'string', description: 'Protein identifier (gene name, UniProt ID, or STRING ID)' },
              species: { type: 'string', description: 'Source species name or NCBI taxonomy ID (default: 9606 for human)' },
              target_species: { type: 'array', items: { type: 'string' }, description: 'Target species to search for homologs (optional)' },
            },
            required: ['protein_id'],
          },
        },
        {
          name: 'search_proteins',
          description: 'Search for proteins by name or identifier across species',
          inputSchema: {
            type: 'object',
            properties: {
              query: { type: 'string', description: 'Search query (protein name, gene name, or identifier)' },
              species: { type: 'string', description: 'Species name or NCBI taxonomy ID (optional)' },
              limit: { type: 'number', description: 'Maximum number of results (default: 10)', minimum: 1, maximum: 100 },
            },
            required: ['query'],
          },
        },
      ],
    }));
  • Utility function to parse TSV data from API responses into typed objects, used by the handler to process annotations.
    private parseTsvData<T>(tsvData: string): T[] {
      const lines = tsvData.trim().split('\n');
      if (lines.length < 2) return [];
    
      const headers = lines[0].split('\t');
      const results: T[] = [];
    
      for (let i = 1; i < lines.length; i++) {
        const values = lines[i].split('\t');
        const obj: any = {};
    
        headers.forEach((header, index) => {
          const value = values[index] || '';
          // Convert numeric fields
          if (['score', 'nscore', 'fscore', 'pscore', 'ascore', 'escore', 'dscore', 'tscore',
               'ncbiTaxonId', 'protein_size', 'number_of_genes', 'number_of_genes_in_background',
               'pvalue', 'pvalue_fdr'].includes(header)) {
            obj[header] = parseFloat(value) || 0;
          } else {
            obj[header] = value;
          }
        });
    
        results.push(obj as T);
      }
    
      return results;
    }
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 states what the tool does but lacks details on traits like whether it's read-only, potential rate limits, authentication needs, or what 'detailed annotations' entail in terms of output format or data scope. This is inadequate for a tool with no annotation coverage.

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 directly states the tool's purpose without unnecessary words. It is front-loaded and appropriately sized, making it easy to parse quickly.

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 of protein annotation retrieval, no annotations, and no output schema, the description is insufficient. It does not explain what 'detailed annotations' include, how results are structured, or any limitations (e.g., maximum protein IDs). This 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%, with clear descriptions for both parameters in the input schema. The description does not add any additional meaning beyond the schema, such as explaining the format of protein identifiers or species names. Baseline score of 3 is appropriate as the schema handles the parameter documentation adequately.

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 ('detailed annotations and functional information for proteins'), making the purpose understandable. However, it does not explicitly differentiate from sibling tools like 'search_proteins' or 'get_functional_enrichment', which might also involve protein information retrieval, so it lacks sibling 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 such as 'search_proteins' or 'get_interaction_network'. It does not mention prerequisites, exclusions, or specific contexts for usage, leaving the agent to infer based on tool names 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/STRING-db-MCP-Server'

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