Skip to main content
Glama
geneontology

Noctua MCP Server

Official
by geneontology

model_summary

Generate a summary for GO-CAM biological models to analyze structure, count components, and review predicate distributions for research insights.

Instructions

Get a summary of a GO-CAM model including counts and key information.

Args: model_id: The GO-CAM model identifier

Returns: Summary with individual count, fact count, and predicate distribution

Examples: # Get summary of a model result = model_summary("gomodel:5fce9b7300001215") # Returns: # { # "model_id": "gomodel:5fce9b7300001215", # "state": "production", # "individual_count": 42, # "fact_count": 67, # "predicate_distribution": { # "RO:0002333": 15, # enabled_by (note: not in vetted list) # "RO:0002411": 8, # causally upstream of # "BFO:0000066": 12, # occurs_in # "BFO:0000050": 5 # part_of # } # }

# Check if a model is empty
result = model_summary("gomodel:new_empty_model")
if result["individual_count"] == 0:
    print("Model is empty")

# Analyze model complexity
result = model_summary("gomodel:12345")
causal_edges = result["predicate_distribution"].get("RO:0002411", 0)
causal_edges += result["predicate_distribution"].get("RO:0002413", 0)  # provides input for
causal_edges += result["predicate_distribution"].get("RO:0002629", 0)  # directly positively regulates
causal_edges += result["predicate_distribution"].get("RO:0002630", 0)  # directly negatively regulates
print(f"Model has {causal_edges} causal relationships")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
model_idYes

Implementation Reference

  • The handler function for the 'model_summary' tool. It fetches the GO-CAM model using BaristaClient.get_model(), then computes summary statistics: number of individuals, facts, model state, and a distribution of predicates used in facts.
    @mcp.tool()
    async def model_summary(model_id: str) -> Dict[str, Any]:
        """
        Get a summary of a GO-CAM model including counts and key information.
    
        Args:
            model_id: The GO-CAM model identifier
    
        Returns:
            Summary with individual count, fact count, and predicate distribution
    
        Examples:
            # Get summary of a model
            result = model_summary("gomodel:5fce9b7300001215")
            # Returns:
            # {
            #   "model_id": "gomodel:5fce9b7300001215",
            #   "state": "production",
            #   "individual_count": 42,
            #   "fact_count": 67,
            #   "predicate_distribution": {
            #     "RO:0002333": 15,  # enabled_by (note: not in vetted list)
            #     "RO:0002411": 8,   # causally upstream of
            #     "BFO:0000066": 12,  # occurs_in
            #     "BFO:0000050": 5    # part_of
            #   }
            # }
    
            # Check if a model is empty
            result = model_summary("gomodel:new_empty_model")
            if result["individual_count"] == 0:
                print("Model is empty")
    
            # Analyze model complexity
            result = model_summary("gomodel:12345")
            causal_edges = result["predicate_distribution"].get("RO:0002411", 0)
            causal_edges += result["predicate_distribution"].get("RO:0002413", 0)  # provides input for
            causal_edges += result["predicate_distribution"].get("RO:0002629", 0)  # directly positively regulates
            causal_edges += result["predicate_distribution"].get("RO:0002630", 0)  # directly negatively regulates
            print(f"Model has {causal_edges} causal relationships")
        """
        client = get_client()
        resp = client.get_model(model_id)
    
        if resp.validation_failed:
            return {
                "success": False,
                "error": "Validation failed",
                "reason": resp.validation_reason,
                "model_id": model_id
            }
    
        if resp.error:
            return {
                "success": False,
                "error": "Failed to retrieve model",
                "reason": resp.error,
                "model_id": model_id
            }
    
        # Extract summary information
        individuals = resp.individuals
        facts = resp.facts
    
        # Count predicates
        predicate_counts: Dict[str, int] = {}
        for fact in facts:
            # fact is now a Pydantic Fact object, not a dict
            pred = fact.property if hasattr(fact, 'property') else "unknown"
            predicate_counts[pred] = predicate_counts.get(pred, 0) + 1
    
        # Get model state if available
        model_state = resp.model_state
    
        return {
            "success": True,
            "model_id": model_id,
            "state": model_state,
            "individual_count": len(individuals),
            "fact_count": len(facts),
            "predicate_distribution": predicate_counts,
        }
  • Helper function to lazily initialize and return the shared BaristaClient instance used by model_summary and other tools.
    def get_client() -> BaristaClient:
        """Get or create the Barista client instance."""
        global _client
        if _client is None:
            _client = BaristaClient()
        return _client
  • FastMCP tool registration decorator for the model_summary handler.
    @mcp.tool()

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