Skip to main content
Glama
biocontext-ai

BioContextAI Knowledgebase MCP

Official

bc_get_string_interactions

Retrieve protein-protein interactions for a specified protein with customizable score thresholds to analyze molecular relationships in biological research.

Instructions

Retrieve protein-protein interactions for a given protein with scores above threshold. Always provide species parameter.

Returns: list or dict: Protein interactions array with stringId_A, stringId_B, preferredName_A/B, score, evidence channels or error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
protein_symbolYesProtein name to search for (e.g., 'TP53')
speciesYesSpecies taxonomy ID (e.g., '10090' for mouse)
min_scoreNoMinimum combined score threshold (0-1000)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'bc_get_string_interactions' tool (registered under 'BC' namespace as 'bc_get_string_interactions'). Resolves protein STRING ID using helper and queries STRING API for interactions.
    @core_mcp.tool()
    def get_string_interactions(
        protein_symbol: Annotated[str, Field(description="Protein name to search for (e.g., 'TP53')")],
        species: Annotated[str, Field(description="Species taxonomy ID (e.g., '10090' for mouse)")],
        min_score: Annotated[int, Field(description="Minimum combined score threshold (0-1000)", ge=0, le=1000)] = 700,
    ) -> Union[List[Dict[str, Any]], dict]:
        """Retrieve protein-protein interactions for a given protein with scores above threshold. Always provide species parameter.
    
        Returns:
            list or dict: Protein interactions array with stringId_A, stringId_B, preferredName_A/B, score, evidence channels or error message.
        """
        # First resolve the protein name to a STRING ID
        try:
            string_id = get_string_id.fn(protein_symbol=protein_symbol, species=species)
    
            if not string_id or not isinstance(string_id, str):
                return {"error": f"No STRING ID found for protein: {protein_symbol}"}
    
            url = f"https://string-db.org/api/json/interaction_partners?identifiers={string_id}&species={species}&required_score={min_score}&format=json"
            response = requests.get(url)
            response.raise_for_status()
    
            return response.json()
        except requests.exceptions.RequestException as e:
            return {"error": f"Failed to fetch interactions: {e!s}"}
        except Exception as e:
            return {"error": f"An error occurred: {e!s}"}
  • Input schema defined via Pydantic Annotated types and Field descriptions for protein_symbol (str), species (str), min_score (int, default 700). Output is list of interaction dicts or error dict.
    def get_string_interactions(
        protein_symbol: Annotated[str, Field(description="Protein name to search for (e.g., 'TP53')")],
        species: Annotated[str, Field(description="Species taxonomy ID (e.g., '10090' for mouse)")],
        min_score: Annotated[int, Field(description="Minimum combined score threshold (0-1000)", ge=0, le=1000)] = 700,
    ) -> Union[List[Dict[str, Any]], dict]:
  • Imports the core_mcp server (containing this tool) into the main MCP app with prefix 'bc' (from slugify('BC')), effectively registering the tool as 'bc_get_string_interactions'.
    for mcp in [core_mcp, *(await get_openapi_mcps())]:
        await mcp_app.import_server(
            mcp,
            slugify(mcp.name),
        )
  • Imports and uses get_string_id helper function to resolve protein_symbol to STRING ID before querying interactions.
    from biocontext_kb.core.stringdb._get_string_id import get_string_id
  • Calls the get_string_id helper to obtain the STRING ID for the given protein and species.
    string_id = get_string_id.fn(protein_symbol=protein_symbol, species=species)
Behavior3/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. It mentions the threshold filtering behavior and return format (list/dict with specific fields or error message), which adds useful context. However, it lacks details on rate limits, authentication needs, pagination, or what constitutes an error scenario beyond the basic output structure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured in two sentences: one stating the purpose and key constraint, and another detailing the return format. There is no wasted text, and information is front-loaded with the core functionality. A slight deduction for not being maximally concise (e.g., the return format could be integrated more seamlessly).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/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 (3 parameters, no nested objects), 100% schema coverage, and presence of an output schema (implied by 'Returns' section), the description is reasonably complete. It covers purpose, key constraint, and output structure, though it could benefit from more behavioral context (e.g., error handling, performance notes) to fully compensate for the lack of annotations.

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%, with each parameter well-documented in the schema (e.g., protein_symbol as 'Protein name to search for', species as 'Species taxonomy ID', min_score with range and default). The description adds minimal value beyond this, only reinforcing the threshold concept and species requirement without providing additional syntax or format details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Retrieve protein-protein interactions'), resource ('for a given protein'), and key constraints ('with scores above threshold'). It distinguishes itself from sibling tools like 'bc_get_string_similarity_scores' or 'bc_get_string_network_image' by focusing on interaction data retrieval rather than similarity scoring or network visualization.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance to 'Always provide species parameter', which is crucial for correct usage. However, it does not specify when to use this tool versus alternatives like 'bc_get_string_similarity_scores' or 'bc_get_string_id', nor does it mention any prerequisites or exclusions beyond the required parameters.

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/biocontext-ai/knowledgebase-mcp'

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