Skip to main content
Glama
geneontology

Noctua MCP Server

Official
by geneontology

add_entity_set

Adds validated functionally interchangeable entities as an atomic set to a GO-CAM model using the has substitutable entity relation for biological knowledge representation.

Instructions

Add an entity set to a GO-CAM model with validated members.

Creates an entity set (CHEBI:33695 "information biomacromolecule" by default) representing functionally interchangeable entities. Links members using RO:0019003 (has substitutable entity) relation. The operation is atomic - either all members are added successfully or the entire operation is rolled back.

Args: model_id: The GO-CAM model identifier members: List of member dictionaries with keys: - entity_id (required): Entity ID (e.g., "UniProtKB:P12345") - label (optional): Member 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 set (default: "set1")

Returns: Barista API response with set ID and member IDs

Examples: # Create a set of functionally equivalent kinases add_entity_set( "gomodel:12345", [ {"entity_id": "UniProtKB:P31749", "label": "AKT1"}, {"entity_id": "UniProtKB:P31751", "label": "AKT2"}, {"entity_id": "UniProtKB:Q9Y243", "label": "AKT3"} ], assign_var="akt_isoforms" )

# Create set with evidence
add_entity_set(
    "gomodel:12345",
    [
        {
            "entity_id": "UniProtKB:P04637",
            "label": "TP53",
            "evidence_type": "ECO:0000314",
            "reference": "PMID:87654321"
        },
        {
            "entity_id": "UniProtKB:P04049",
            "label": "RAF1",
            "evidence_type": "ECO:0000314",
            "reference": "PMID:87654321"
        }
    ],
)

Notes: - All members must have entity_id specified - Label validation prevents ID hallucination - Evidence and references are optional but recommended - Uses RO:0019003 (has substitutable entity) to link members - Atomic operation with automatic rollback on failure - Entity sets represent functionally interchangeable entities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
model_idYes
membersYes
assign_varNoset1

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler for the 'add_entity_set' MCP tool. This async function is decorated with @mcp.tool(), registering it automatically. It handles input validation using Pydantic EntitySetMember models, calls the underlying BaristaClient.add_entity_set, processes the response, and returns structured results including success status, set ID, and member count.
    @mcp.tool()
    async def add_entity_set(
        model_id: str,
        members: List[Dict[str, Any]],
        assign_var: str = "set1"
    ) -> Dict[str, Any]:
        """
        Add an entity set to a GO-CAM model with validated members.
    
        Creates an entity set (CHEBI:33695 "information biomacromolecule" by default)
        representing functionally interchangeable entities. Links members using
        RO:0019003 (has substitutable entity) relation. The operation is atomic -
        either all members are added successfully or the entire operation is rolled back.
    
        Args:
            model_id: The GO-CAM model identifier
            members: List of member dictionaries with keys:
                    - entity_id (required): Entity ID (e.g., "UniProtKB:P12345")
                    - label (optional): Member 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 set (default: "set1")
    
        Returns:
            Barista API response with set ID and member IDs
    
        Examples:
            # Create a set of functionally equivalent kinases
            add_entity_set(
                "gomodel:12345",
                [
                    {"entity_id": "UniProtKB:P31749", "label": "AKT1"},
                    {"entity_id": "UniProtKB:P31751", "label": "AKT2"},
                    {"entity_id": "UniProtKB:Q9Y243", "label": "AKT3"}
                ],
                assign_var="akt_isoforms"
            )
    
            # Create set with evidence
            add_entity_set(
                "gomodel:12345",
                [
                    {
                        "entity_id": "UniProtKB:P04637",
                        "label": "TP53",
                        "evidence_type": "ECO:0000314",
                        "reference": "PMID:87654321"
                    },
                    {
                        "entity_id": "UniProtKB:P04049",
                        "label": "RAF1",
                        "evidence_type": "ECO:0000314",
                        "reference": "PMID:87654321"
                    }
                ],
            )
    
        Notes:
            - All members must have entity_id specified
            - Label validation prevents ID hallucination
            - Evidence and references are optional but recommended
            - Uses RO:0019003 (has substitutable entity) to link members
            - Atomic operation with automatic rollback on failure
            - Entity sets represent functionally interchangeable entities
        """
        client = get_client()
    
        # Convert member dicts to Pydantic models
        try:
            pydantic_members = [EntitySetMember(**member) for member in members]
        except Exception as e:
            return {
                "success": False,
                "error": "Invalid member structure",
                "reason": str(e),
                "hint": "Each member must have 'entity_id' field. Optional: 'label', 'evidence_type', 'reference'"
            }
    
        # Call the new add_entity_set method
        resp = client.add_entity_set(
            model_id,
            pydantic_members,
            assign_var=assign_var,
        )
    
        if resp.validation_failed:
            return {
                "success": False,
                "error": "Validation failed",
                "reason": resp.validation_reason,
                "rolled_back": True,
                "member_count": len(members)
            }
    
        if resp.error:
            return {
                "success": False,
                "error": resp.error,
                "model_id": model_id,
            }
    
        # Get the set ID from model_vars or from the individuals list
        set_id = assign_var
        if resp.model_vars and assign_var in resp.model_vars:
            set_id = resp.model_vars[assign_var]
        elif resp.individuals and len(resp.individuals) > 0:
            # Find the set individual - it should be the first one created
            # Look for an entity set (typically CHEBI:33695 or similar)
            for ind in resp.individuals:
                if hasattr(ind, 'type') and any('CHEBI' in str(t.id) if hasattr(t, 'id') else False for t in ind.type):
                    set_id = ind.id
                    break
    
        return {
            "success": True,
            "set_id": set_id,
            "member_count": len(members),
            "assign_var": assign_var
        }
Behavior5/5

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

With no annotations provided, the description carries full burden and delivers excellent behavioral disclosure. It explains the atomic nature of the operation with rollback, describes validation processes (label validation prevents ID hallucination), specifies the default entity type (CHEBI:33695), documents the linking relation (RO:0019003), and explains what the tool returns. This provides comprehensive behavioral context beyond basic functionality.

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 well-structured and efficiently organized with clear sections (purpose, args, returns, examples, notes). Every sentence earns its place by providing essential information without redundancy. The front-loaded purpose statement immediately communicates the tool's function, followed by progressively detailed information.

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?

For a tool with 3 parameters, 0% schema description coverage, no annotations, but with output schema, the description provides complete context. It covers purpose, parameters, behavior, examples, and operational notes. The existence of an output schema means the description doesn't need to detail return values, and it appropriately focuses on usage context and parameter 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 each parameter's purpose, required vs optional status, format expectations (e.g., 'gomodel:12345' format for model_id), and the structure of the members array including all dictionary keys with examples. The description adds substantial value beyond the bare schema.

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 entity set'), the target ('to a GO-CAM model'), and the key characteristic ('with validated members'). It distinguishes this tool from siblings like 'add_individual' or 'add_protein_complex' by specifying it creates entity sets representing functionally interchangeable entities linked via RO:0019003 relation.

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 (creating entity sets with validated members in 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 for different scenarios, though the sibling list suggests alternatives like 'add_individual' or 'add_protein_complex' for different entity types.

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