Skip to main content
Glama
geneontology

Noctua MCP Server

Official
by geneontology

add_individual

Adds an instance of a biological class to a GO-CAM model with label validation to prevent incorrect ID usage, automatically rolling back if labels don't match.

Instructions

Add an individual (instance) of a class to a GO-CAM model with label validation.

This tool requires providing the expected label for the class to prevent accidental use of wrong IDs (e.g., GO:0003924 vs GO:0003925). The operation will automatically rollback if the created individual doesn't match the expected label.

Args: model_id: The GO-CAM model identifier (e.g., "gomodel:12345") class_curie: The class to instantiate (e.g., "GO:0003674") class_label: The expected rdfs:label of the class (e.g., "molecular_function") assign_var: Variable name for referencing in the same batch

Returns: Barista API response with message-type and signal fields. If validation fails, includes rolled_back=true and validation error.

Examples: # Add a molecular function activity with validation add_individual("gomodel:12345", "GO:0004672", "protein kinase activity", "mf1")

# Add a protein/gene product with validation
add_individual("gomodel:12345", "UniProtKB:P38398", "BRCA1", "gp1")

# Add a cellular component with validation
add_individual("gomodel:12345", "GO:0005737", "cytoplasm", "cc1")

# Add a biological process with validation
add_individual("gomodel:12345", "GO:0016055", "Wnt signaling pathway", "bp1")

# Add an evidence instance with validation
add_individual("gomodel:12345", "ECO:0000353", "physical interaction evidence", "ev1")

# Variables like "mf1", "gp1" can be referenced in subsequent
# add_fact calls within the same batch operation

Notes: - The label acts as a checksum to prevent ID hallucination - If the label doesn't match, the operation is automatically rolled back - This prevents corrupt models from incorrect IDs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
model_idYes
class_curieYes
class_labelYes
assign_varNox1

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'add_individual' MCP tool. It validates input, calls BaristaClient.add_individual with label checksum, handles errors/rollback, and returns the individual ID or error details.
    @mcp.tool()
    async def add_individual(
        model_id: str,
        class_curie: str,
        class_label: str,
        assign_var: str = "x1"
    ) -> Dict[str, Any]:
        """
        Add an individual (instance) of a class to a GO-CAM model with label validation.
    
        This tool requires providing the expected label for the class to prevent
        accidental use of wrong IDs (e.g., GO:0003924 vs GO:0003925). The operation
        will automatically rollback if the created individual doesn't match the
        expected label.
    
        Args:
            model_id: The GO-CAM model identifier (e.g., "gomodel:12345")
            class_curie: The class to instantiate (e.g., "GO:0003674")
            class_label: The expected rdfs:label of the class (e.g., "molecular_function")
            assign_var: Variable name for referencing in the same batch
    
        Returns:
            Barista API response with message-type and signal fields.
            If validation fails, includes rolled_back=true and validation error.
    
        Examples:
            # Add a molecular function activity with validation
            add_individual("gomodel:12345", "GO:0004672", "protein kinase activity", "mf1")
    
            # Add a protein/gene product with validation
            add_individual("gomodel:12345", "UniProtKB:P38398", "BRCA1", "gp1")
    
            # Add a cellular component with validation
            add_individual("gomodel:12345", "GO:0005737", "cytoplasm", "cc1")
    
            # Add a biological process with validation
            add_individual("gomodel:12345", "GO:0016055", "Wnt signaling pathway", "bp1")
    
            # Add an evidence instance with validation
            add_individual("gomodel:12345", "ECO:0000353", "physical interaction evidence", "ev1")
    
            # Variables like "mf1", "gp1" can be referenced in subsequent
            # add_fact calls within the same batch operation
    
        Notes:
            - The label acts as a checksum to prevent ID hallucination
            - If the label doesn't match, the operation is automatically rolled back
            - This prevents corrupt models from incorrect IDs
        """
        client = get_client()
        resp = client.add_individual(model_id, class_curie, assign_var, expected_label=class_label)
    
        if resp.validation_failed:
            return {
                "success": False,
                "error": "Validation failed",
                "reason": resp.validation_reason,
                "rolled_back": True,
                "expected_label": class_label,
                "class_curie": class_curie
            }
    
        if resp.error:
            return {
                "success": False,
                "error": resp.error,
                "model_id": model_id,
                "class_curie": class_curie
            }
    
        # Get the actual individual ID from model_vars or from the individuals list
        individual_id = assign_var
        if resp.model_vars and assign_var in resp.model_vars:
            individual_id = resp.model_vars[assign_var]
        elif resp.individuals and len(resp.individuals) > 0:
            # If model_vars is empty, get the ID from the last individual (the one just created)
            individual_id = resp.individuals[-1].id
    
        # Return minimal success response
        return {
            "success": True,
            "individual_id": individual_id,
            "class_curie": class_curie,
            "assign_var": assign_var
        }
Behavior4/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 so well. It discloses critical behavioral traits: the operation automatically rolls back if validation fails, prevents corrupt models, and acts as a checksum. However, it doesn't mention rate limits, authentication needs, or error handling beyond rollback.

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 appropriately sized and front-loaded with the core purpose. The Args, Returns, Examples, and Notes sections are well-structured. However, the examples section is quite lengthy with 6 examples, which could be condensed while still being informative.

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 (mutation tool with validation), no annotations, and an output schema exists, the description is complete. It explains the purpose, parameters, validation mechanism, rollback behavior, and provides extensive examples. The output schema handles return values, so the description appropriately focuses on behavior and usage.

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?

Schema description coverage is 0%, so the description must compensate fully. It provides detailed semantic explanations for all parameters: model_id as GO-CAM model identifier, class_curie as the class to instantiate, class_label as the expected rdfs:label for validation, and assign_var for referencing in batch operations. The examples further clarify usage.

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 an individual of a class to a GO-CAM model') and distinguishes it from siblings like 'add_entity_set' or 'add_protein_complex' by specifying it's for adding class instances with label validation. It explicitly mentions the resource (GO-CAM model) and the validation mechanism.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool: for adding individuals with label validation to prevent ID hallucination. It distinguishes from alternatives by emphasizing the validation feature and mentions that variables created can be referenced in subsequent 'add_fact' calls, indicating workflow context.

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