Skip to main content
Glama
geneontology

Noctua MCP Server

Official
by geneontology

add_protein_complex

Add validated protein complexes to GO-CAM models with atomic operations that ensure all components are successfully linked or the entire process is rolled back.

Instructions

Add a protein complex to a GO-CAM model with validated components.

Creates a protein-containing complex (GO:0032991 by default) and links all components using BFO:0000051 (has part) relation. The operation is atomic - either all components are added successfully or the entire operation is rolled back.

Args: model_id: The GO-CAM model identifier components: List of component dictionaries with keys: - entity_id (required): Protein/gene product ID (e.g., "UniProtKB:P12345") - label (optional): Component label for validation - evidence_type (optional): ECO code (e.g., "ECO:0000353") - reference (optional): Source reference (e.g., "PMID:12345678") assign_var: Variable name for the complex (default: "complex1")

Returns: Barista API response with complex ID and component IDs

Examples: # Create a simple dimer complex add_protein_complex( "gomodel:12345", [ {"entity_id": "UniProtKB:P04637", "label": "TP53"}, {"entity_id": "UniProtKB:P04637", "label": "TP53"} ], )

# Create complex with evidence
add_protein_complex(
    "gomodel:12345",
    [
        {
            "entity_id": "UniProtKB:P68400",
            "label": "CSNK1A1",
            "evidence_type": "ECO:0000353",
            "reference": "PMID:12345678"
        },
        {
            "entity_id": "UniProtKB:P49841",
            "label": "GSK3B",
            "evidence_type": "ECO:0000353",
            "reference": "PMID:12345678"
        }
    ],
    assign_var="destruction_complex"
)

# Create a complex with specific assignment variable
add_protein_complex(
    "gomodel:12345",
    [
        {"entity_id": "UniProtKB:P62191", "label": "PSMC1"},
        {"entity_id": "UniProtKB:P62195", "label": "PSMC5"}
    ],
    assign_var="proteasome"
)

Notes: - All components must have entity_id specified - Label validation prevents ID hallucination - Evidence and references are optional but recommended - Uses BFO:0000051 (has part) to link components - Atomic operation with automatic rollback on failure

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
model_idYes
componentsYes
assign_varNocomplex1

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function for the 'add_protein_complex' MCP tool. It validates input components using ProteinComplexComponent Pydantic models, delegates execution to BaristaClient.add_protein_complex, handles responses, validation failures with rollback, and returns structured results including the complex ID.
    async def add_protein_complex(
        model_id: str,
        components: List[Dict[str, Any]],
        assign_var: str = "complex1"
    ) -> Dict[str, Any]:
        """
        Add a protein complex to a GO-CAM model with validated components.
    
        Creates a protein-containing complex (GO:0032991 by default) and links
        all components using BFO:0000051 (has part) relation. The operation is
        atomic - either all components are added successfully or the entire
        operation is rolled back.
    
        Args:
            model_id: The GO-CAM model identifier
            components: List of component dictionaries with keys:
                       - entity_id (required): Protein/gene product ID (e.g., "UniProtKB:P12345")
                       - label (optional): Component label for validation
                       - evidence_type (optional): ECO code (e.g., "ECO:0000353")
                       - reference (optional): Source reference (e.g., "PMID:12345678")
            assign_var: Variable name for the complex (default: "complex1")
    
        Returns:
            Barista API response with complex ID and component IDs
    
        Examples:
            # Create a simple dimer complex
            add_protein_complex(
                "gomodel:12345",
                [
                    {"entity_id": "UniProtKB:P04637", "label": "TP53"},
                    {"entity_id": "UniProtKB:P04637", "label": "TP53"}
                ],
            )
    
            # Create complex with evidence
            add_protein_complex(
                "gomodel:12345",
                [
                    {
                        "entity_id": "UniProtKB:P68400",
                        "label": "CSNK1A1",
                        "evidence_type": "ECO:0000353",
                        "reference": "PMID:12345678"
                    },
                    {
                        "entity_id": "UniProtKB:P49841",
                        "label": "GSK3B",
                        "evidence_type": "ECO:0000353",
                        "reference": "PMID:12345678"
                    }
                ],
                assign_var="destruction_complex"
            )
    
            # Create a complex with specific assignment variable
            add_protein_complex(
                "gomodel:12345",
                [
                    {"entity_id": "UniProtKB:P62191", "label": "PSMC1"},
                    {"entity_id": "UniProtKB:P62195", "label": "PSMC5"}
                ],
                assign_var="proteasome"
            )
    
        Notes:
            - All components must have entity_id specified
            - Label validation prevents ID hallucination
            - Evidence and references are optional but recommended
            - Uses BFO:0000051 (has part) to link components
            - Atomic operation with automatic rollback on failure
        """
        client = get_client()
    
        # Convert component dicts to Pydantic models
        try:
            pydantic_components = [ProteinComplexComponent(**comp) for comp in components]
        except Exception as e:
            return {
                "success": False,
                "error": "Invalid component structure",
                "reason": str(e),
                "hint": "Each component must have 'entity_id' field. Optional: 'label', 'evidence_type', 'reference'"
            }
    
        # Call the new add_protein_complex method
        resp = client.add_protein_complex(
            model_id,
            pydantic_components,
            assign_var=assign_var
        )
    
        if resp.validation_failed:
            return {
                "success": False,
                "error": "Validation failed",
                "reason": resp.validation_reason,
                "rolled_back": True,
                "component_count": len(components)
            }
    
        if resp.error:
            return {
                "success": False,
                "error": resp.error,
                "model_id": model_id
            }
    
        # Get the complex ID from model_vars or from the individuals list
        complex_id = assign_var
        if resp.model_vars and assign_var in resp.model_vars:
            complex_id = resp.model_vars[assign_var]
        elif resp.individuals and len(resp.individuals) > 0:
            # Find the complex individual (it should be the first one created in this operation)
            # The complex is created first, then components are added
            for ind in resp.individuals:
                # Check if it's a protein-containing complex
                if hasattr(ind, 'type') and any('GO:0032991' in str(t.id) if hasattr(t, 'id') else False for t in ind.type):
                    complex_id = ind.id
                    break
    
        return {
            "success": True,
            "complex_id": complex_id,
            "component_count": len(components),
            "assign_var": assign_var
        }
  • The @mcp.tool() decorator registers 'add_protein_complex' as an available MCP tool in the FastMCP server.
    async def add_protein_complex(
  • Uses ProteinComplexComponent Pydantic model (imported from noctua.models) for input schema validation of protein complex components.
    pydantic_components = [ProteinComplexComponent(**comp) for comp in components]
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and does an excellent job disclosing behavioral traits. It explains the atomic operation with rollback, validation mechanisms (label validation prevents ID hallucination), default GO term (GO:0032991), specific relation used (BFO:0000051), and operational constraints. This goes well beyond what would be in a basic schema.

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 well-structured with clear sections (purpose, args, returns, examples, notes) and front-loads the core functionality. While comprehensive, some information in the notes section could potentially be integrated more tightly with parameter descriptions. Every sentence adds value, but the overall length is substantial.

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

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of the operation (atomic creation with validation), 0% schema coverage, no annotations, but with an output schema, the description provides complete context. It covers purpose, parameters, behavior, constraints, examples, and operational details. The output schema handles return values, so the description appropriately focuses on usage and semantics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by providing detailed parameter documentation. It explains all three parameters, their purposes, required/optional status, data formats, and provides examples showing proper usage. The components parameter gets especially thorough treatment with explanation of all dictionary keys and their meanings.

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 ('Add a protein complex to a GO-CAM model with validated components'), identifies the resource (GO-CAM model), and distinguishes from siblings like 'add_entity_set' or 'add_individual' by specifying it's for protein-containing complexes using BFO:0000051 relations. The first sentence provides a complete purpose statement.

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 clear context about when to use this tool (for adding protein complexes with validated components to GO-CAM models) and includes usage notes about requirements and recommendations. However, it doesn't explicitly state when NOT to use it or name specific alternative tools from the sibling list for different scenarios.

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/geneontology/noctua-mcp'

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