Skip to main content
Glama
Augmented-Nature

STRING-db MCP Server

get_protein_interactions

Retrieve direct interaction partners for a protein to analyze protein networks and functional relationships using the STRING database.

Instructions

Get direct interaction partners for a specific protein

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
protein_idYesProtein identifier (gene name, UniProt ID, or STRING ID)
speciesNoSpecies name or NCBI taxonomy ID (default: 9606 for human)
limitNoMaximum number of interactions to return (default: 10)
required_scoreNoMinimum interaction confidence score (0-1000, default: 400)

Implementation Reference

  • The main handler function that executes the tool logic: validates input, calls STRING API /tsv/interaction_partners, parses TSV data into ProteinInteraction objects, formats response as JSON with interaction details and evidence scores.
    private async handleGetProteinInteractions(args: any) {
      if (!isValidProteinArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid protein interaction arguments');
      }
    
      try {
        const species = args.species || '9606';
        const limit = args.limit || 10;
        const requiredScore = args.required_score || 400;
    
        const response = await this.apiClient.get('/tsv/interaction_partners', {
          params: {
            identifiers: args.protein_id,
            species: species,
            limit: limit,
            required_score: requiredScore,
          },
        });
    
        const interactions = this.parseTsvData<ProteinInteraction>(response.data);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                query_protein: args.protein_id,
                species: species,
                total_interactions: interactions.length,
                interactions: interactions.map(int => ({
                  partner_protein: int.preferredName_B,
                  string_id: int.stringId_B,
                  confidence_score: int.score,
                  evidence_scores: {
                    neighborhood: int.nscore,
                    fusion: int.fscore,
                    cooccurrence: int.pscore,
                    coexpression: int.ascore,
                    experimental: int.escore,
                    database: int.dscore,
                    textmining: int.tscore,
                  }
                }))
              }, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error fetching protein interactions: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema definition for the tool, specifying required protein_id and optional parameters for species, limit, and minimum score.
    inputSchema: {
      type: 'object',
      properties: {
        protein_id: { type: 'string', description: 'Protein identifier (gene name, UniProt ID, or STRING ID)' },
        species: { type: 'string', description: 'Species name or NCBI taxonomy ID (default: 9606 for human)' },
        limit: { type: 'number', description: 'Maximum number of interactions to return (default: 10)', minimum: 1, maximum: 2000 },
        required_score: { type: 'number', description: 'Minimum interaction confidence score (0-1000, default: 400)', minimum: 0, maximum: 1000 },
      },
      required: ['protein_id'],
    },
  • src/index.ts:395-396 (registration)
    Tool registration in the CallToolRequestSchema switch statement, dispatching to the handler function.
    case 'get_protein_interactions':
      return this.handleGetProteinInteractions(args);
  • src/index.ts:309-321 (registration)
    Tool registration in the ListToolsRequestSchema response, including name, description, and input schema.
      name: 'get_protein_interactions',
      description: 'Get direct interaction partners for a specific protein',
      inputSchema: {
        type: 'object',
        properties: {
          protein_id: { type: 'string', description: 'Protein identifier (gene name, UniProt ID, or STRING ID)' },
          species: { type: 'string', description: 'Species name or NCBI taxonomy ID (default: 9606 for human)' },
          limit: { type: 'number', description: 'Maximum number of interactions to return (default: 10)', minimum: 1, maximum: 2000 },
          required_score: { type: 'number', description: 'Minimum interaction confidence score (0-1000, default: 400)', minimum: 0, maximum: 1000 },
        },
        required: ['protein_id'],
      },
    },
  • Type guard function for validating input arguments to the get_protein_interactions tool.
    const isValidProteinArgs = (
      args: any
    ): args is { protein_id: string; species?: string; limit?: number; required_score?: number } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        typeof args.protein_id === 'string' &&
        args.protein_id.length > 0 &&
        (args.species === undefined || typeof args.species === 'string') &&
        (args.limit === undefined || (typeof args.limit === 'number' && args.limit > 0 && args.limit <= 2000)) &&
        (args.required_score === undefined || (typeof args.required_score === 'number' && args.required_score >= 0 && args.required_score <= 1000))
      );
    };
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 mentions 'direct interaction partners' but doesn't specify data sources, rate limits, authentication needs, error handling, or what constitutes a 'direct' interaction. For a tool with 4 parameters and no output schema, this leaves significant behavioral gaps.

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, focused sentence with zero wasted words. It's appropriately sized for a straightforward query tool and front-loads the core purpose without unnecessary elaboration.

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 4 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain return values, data formats, error conditions, or how parameters interact (e.g., how 'species' affects 'protein_id' resolution). For a biological data query tool, more context is needed.

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 all parameters are documented in the schema. The description adds no additional parameter semantics beyond implying the tool focuses on 'direct' interactions, which might relate to the 'required_score' parameter. This 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 verb 'Get' and the resource 'direct interaction partners for a specific protein', making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_interaction_network' or 'search_proteins', which might offer overlapping functionality.

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 like 'get_interaction_network' or 'search_proteins'. It lacks context about use cases, prerequisites, or exclusions, leaving the agent to infer usage 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